Skip to content

Commit 83d35ff

Browse files
devnexentgross35
authored andcommitted
adding getentropy/getrandom to dragonflybsd.
(apply <#3618> to `main`) (cherry picked from commit e79e95f)
1 parent e19650d commit 83d35ff

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

libc-test/semver/dragonfly.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ GLOB_NOESCAPE
326326
GLOB_NOMATCH
327327
GLOB_NOSORT
328328
GLOB_NOSPACE
329+
GRND_INSECURE
330+
GRND_NONBLOCK
331+
GRND_RANDOM
329332
HW_BYTEORDER
330333
HW_DISKNAMES
331334
HW_DISKSTATS
@@ -1308,6 +1311,7 @@ fstatfs
13081311
futimes
13091312
getdomainname
13101313
getdtablesize
1314+
getentropy
13111315
getgrent
13121316
getgrent_r
13131317
getgrgid
@@ -1331,6 +1335,7 @@ getprogname
13311335
getpwent
13321336
getpwent_r
13331337
getpwnam_r
1338+
getrandom
13341339
getresgid
13351340
getresuid
13361341
getrlimit

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3997,11 +3997,6 @@ pub const F_SEAL_WRITE: ::c_int = 8;
39973997
// for use with fspacectl
39983998
pub const SPACECTL_DEALLOC: ::c_int = 1;
39993999

4000-
// For getrandom()
4001-
pub const GRND_NONBLOCK: ::c_uint = 0x1;
4002-
pub const GRND_RANDOM: ::c_uint = 0x2;
4003-
pub const GRND_INSECURE: ::c_uint = 0x4;
4004-
40054000
// For realhostname* api
40064001
pub const HOSTNAME_FOUND: ::c_int = 0;
40074002
pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
@@ -5513,8 +5508,6 @@ extern "C" {
55135508

55145509
pub fn fdatasync(fd: ::c_int) -> ::c_int;
55155510

5516-
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
5517-
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
55185511
pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
55195512
pub fn setproctitle_fast(fmt: *const ::c_char, ...);
55205513
pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,11 @@ pub const RB_GDB: ::c_int = 0x8000;
14501450
pub const RB_MUTE: ::c_int = 0x10000;
14511451
pub const RB_SELFTEST: ::c_int = 0x20000;
14521452

1453+
// For getrandom()
1454+
pub const GRND_NONBLOCK: ::c_uint = 0x1;
1455+
pub const GRND_RANDOM: ::c_uint = 0x2;
1456+
pub const GRND_INSECURE: ::c_uint = 0x4;
1457+
14531458
safe_f! {
14541459
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
14551460
status == 0x13
@@ -1819,6 +1824,9 @@ extern "C" {
18191824
abs_timeout: *const ::timespec,
18201825
) -> ::c_int;
18211826
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;
1827+
1828+
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
1829+
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
18221830
}
18231831

18241832
#[link(name = "util")]

0 commit comments

Comments
 (0)