File tree 1 file changed +1
-17
lines changed
1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -201,24 +201,8 @@ mod sysrand_chunk {
201
201
202
202
#[ inline]
203
203
pub fn chunk ( dest : & mut [ u8 ] ) -> Result < usize , error:: Unspecified > {
204
- use libc:: c_long;
205
-
206
- // See `SYS_getrandom` in #include <sys/syscall.h>.
207
-
208
- #[ cfg( target_arch = "aarch64" ) ]
209
- const SYS_GETRANDOM : c_long = 278 ;
210
-
211
- #[ cfg( target_arch = "arm" ) ]
212
- const SYS_GETRANDOM : c_long = 384 ;
213
-
214
- #[ cfg( target_arch = "x86" ) ]
215
- const SYS_GETRANDOM : c_long = 355 ;
216
-
217
- #[ cfg( target_arch = "x86_64" ) ]
218
- const SYS_GETRANDOM : c_long = 318 ;
219
-
220
204
let chunk_len: c:: size_t = dest. len ( ) ;
221
- let r = unsafe { libc:: syscall ( SYS_GETRANDOM , dest. as_mut_ptr ( ) , chunk_len, 0 ) } ;
205
+ let r = unsafe { libc:: syscall ( libc :: SYS_getrandom , dest. as_mut_ptr ( ) , chunk_len, 0 ) } ;
222
206
if r < 0 {
223
207
let errno;
224
208
You can’t perform that action at this time.
0 commit comments