Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding getentropy/getrandom to dragonflybsd. #3618

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ GLOB_NOESCAPE
GLOB_NOMATCH
GLOB_NOSORT
GLOB_NOSPACE
GRND_INSECURE
GRND_NONBLOCK
GRND_RANDOM
HW_BYTEORDER
HW_DISKNAMES
HW_DISKSTATS
Expand Down Expand Up @@ -1308,6 +1311,7 @@ fstatfs
futimes
getdomainname
getdtablesize
getentropy
getgrent
getgrent_r
getgrgid
Expand All @@ -1331,6 +1335,7 @@ getprogname
getpwent
getpwent_r
getpwnam_r
getrandom
getresgid
getresuid
getrlimit
Expand Down
7 changes: 0 additions & 7 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3875,11 +3875,6 @@ pub const F_SEAL_WRITE: ::c_int = 8;
// for use with fspacectl
pub const SPACECTL_DEALLOC: ::c_int = 1;

// For getrandom()
pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;

// For realhostname* api
pub const HOSTNAME_FOUND: ::c_int = 0;
pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
Expand Down Expand Up @@ -5393,8 +5388,6 @@ extern "C" {

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

pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
pub fn elf_aux_info(aux: ::c_int, buf: *mut ::c_void, buflen: ::c_int) -> ::c_int;
pub fn setproctitle_fast(fmt: *const ::c_char, ...);
pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
Expand Down
8 changes: 8 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,11 @@ pub const RB_GDB: ::c_int = 0x8000;
pub const RB_MUTE: ::c_int = 0x10000;
pub const RB_SELFTEST: ::c_int = 0x20000;

// For getrandom()
pub const GRND_NONBLOCK: ::c_uint = 0x1;
pub const GRND_RANDOM: ::c_uint = 0x2;
pub const GRND_INSECURE: ::c_uint = 0x4;

safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
Expand Down Expand Up @@ -1829,6 +1834,9 @@ extern "C" {
abs_timeout: *const ::timespec,
) -> ::c_int;
pub fn mq_unlink(name: *const ::c_char) -> ::c_int;

pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int;
}

#[link(name = "util")]
Expand Down