Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,7 @@ fn test_dragonflybsd(target: &str) {
"sys/mount.h",
"sys/procctl.h",
"sys/ptrace.h",
"sys/random.h",
"sys/reboot.h",
"sys/resource.h",
"sys/rtprio.h",
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1587,3 +1587,7 @@ xucred
eaccess
dirname
basename
GRND_RANDOM
GRND_NONBLOCK
GRND_INSECURE
getrandom
6 changes: 6 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,11 @@ pub const NGROUPS: usize = 16;
pub const RB_PAUSE: ::c_int = 0x40000;
pub const RB_VIDEO: ::c_int = 0x20000000;

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

const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
Expand Down Expand Up @@ -1684,6 +1689,7 @@ extern "C" {
mntvbufp: *mut *mut ::statvfs,
flags: ::c_int,
) -> ::c_int;
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}

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