diff options
| author | Michael McConville <mmcco@mykolab.com> | 2015-12-23 22:46:45 -0500 |
|---|---|---|
| committer | Michael McConville <mmcco@mykolab.com> | 2015-12-23 22:46:45 -0500 |
| commit | b0a9b3d4581524c075e43626c4bac4ba7ee01255 (patch) | |
| tree | aa12a1aada87e2fa7fee25c42a173783d891de4a | |
| parent | 4ce1dafd1d58852a88f38a0f63cb11236a7470cb (diff) | |
| download | rust-b0a9b3d4581524c075e43626c4bac4ba7ee01255.tar.gz rust-b0a9b3d4581524c075e43626c4bac4ba7ee01255.zip | |
Use libc's Linux syscall()
There's no need for us to redeclare it in an extern block.
| -rw-r--r-- | src/libstd/rand/os.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index c7cb10a4707..45c29e83b39 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -32,10 +32,6 @@ mod imp { target_arch = "aarch64", target_arch = "powerpc")))] fn getrandom(buf: &mut [u8]) -> libc::c_long { - extern "C" { - fn syscall(number: libc::c_long, ...) -> libc::c_long; - } - #[cfg(target_arch = "x86_64")] const NR_GETRANDOM: libc::c_long = 318; #[cfg(target_arch = "x86")] @@ -46,7 +42,7 @@ mod imp { const NR_GETRANDOM: libc::c_long = 278; unsafe { - syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0) + libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0) } } |
