Skip to content

Commit 9007d63

Browse files
committed
Auto merge of #30548 - mmcco:linux-syscall, r=brson
There's no need for us to redeclare it in an extern block. We should probably put the syscall number constants in libc too.
2 parents 27a1834 + b0a9b3d commit 9007d63

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/libstd/rand/os.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ mod imp {
3232
target_arch = "aarch64",
3333
target_arch = "powerpc")))]
3434
fn getrandom(buf: &mut [u8]) -> libc::c_long {
35-
extern "C" {
36-
fn syscall(number: libc::c_long, ...) -> libc::c_long;
37-
}
38-
3935
#[cfg(target_arch = "x86_64")]
4036
const NR_GETRANDOM: libc::c_long = 318;
4137
#[cfg(target_arch = "x86")]
@@ -46,7 +42,7 @@ mod imp {
4642
const NR_GETRANDOM: libc::c_long = 278;
4743

4844
unsafe {
49-
syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0)
45+
libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), 0)
5046
}
5147
}
5248

0 commit comments

Comments
 (0)