From 405e557d6c1d26057920a6c00943357a8dd12480 Mon Sep 17 00:00:00 2001 From: Michael McConville Date: Fri, 18 Dec 2015 00:09:43 -0500 Subject: [PATCH 1/2] Add getentropy(2)'s syscall number as a const I'm not convinced that the NR_* naming scheme is ideal, but it's pretty good. I didn't recognize any other syscall numbers in the file, so I started a new section. --- src/unix/bsd/openbsdlike/openbsd.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/unix/bsd/openbsdlike/openbsd.rs b/src/unix/bsd/openbsdlike/openbsd.rs index 76f946d9af579..dad9933acf06c 100644 --- a/src/unix/bsd/openbsdlike/openbsd.rs +++ b/src/unix/bsd/openbsdlike/openbsd.rs @@ -211,6 +211,9 @@ pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; pub const HW_AVAILCPU: ::c_int = 25; pub const KERN_PROC_ARGS: ::c_int = 55; +// syscall numbers +pub const NR_GETENTROPY: c_int = 7; + extern { pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int; From 3d372e605afb2f7424fdfbace9ebea990947c106 Mon Sep 17 00:00:00 2001 From: Michael McConville Date: Fri, 18 Dec 2015 00:19:00 -0500 Subject: [PATCH 2/2] Fix build by adding type prefix colons --- src/unix/bsd/openbsdlike/openbsd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix/bsd/openbsdlike/openbsd.rs b/src/unix/bsd/openbsdlike/openbsd.rs index dad9933acf06c..dea5e8e49a8eb 100644 --- a/src/unix/bsd/openbsdlike/openbsd.rs +++ b/src/unix/bsd/openbsdlike/openbsd.rs @@ -212,7 +212,7 @@ pub const HW_AVAILCPU: ::c_int = 25; pub const KERN_PROC_ARGS: ::c_int = 55; // syscall numbers -pub const NR_GETENTROPY: c_int = 7; +pub const NR_GETENTROPY: ::c_int = 7; extern { pub fn mprotect(addr: *const ::c_void, len: ::size_t, prot: ::c_int)