summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVal Packett <val@packett.cool>2023-05-07 04:11:03 -0300
committerVal Packett <val@packett.cool>2023-05-07 04:25:03 -0300
commitd596cdf62ba846a7d7ecb9cefd5e265c59cbf2c1 (patch)
treeac9fc492c515e4b54a46ce3b234b0c27d11127d2
parentc461e304db322c53e8d0b28ae9192e9075b54a03 (diff)
downloadrust-libc-d596cdf62ba846a7d7ecb9cefd5e265c59cbf2c1.tar.gz
freebsdlike: add reboot
-rw-r--r--libc-test/build.rs2
-rw-r--r--libc-test/semver/dragonfly.txt19
-rw-r--r--libc-test/semver/freebsd.txt22
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs3
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs6
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs19
6 files changed, 71 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 6d07d5bfc9..2f993486ef 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1277,6 +1277,7 @@ fn test_dragonflybsd(target: &str) {
"sys/mount.h",
"sys/procctl.h",
"sys/ptrace.h",
+ "sys/reboot.h",
"sys/resource.h",
"sys/rtprio.h",
"sys/sched.h",
@@ -1993,6 +1994,7 @@ fn test_freebsd(target: &str) {
"sys/ptrace.h",
"sys/queue.h",
"sys/random.h",
+ "sys/reboot.h",
"sys/resource.h",
"sys/rtprio.h",
"sys/sem.h",
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index e6b252e205..e73dd3dc7e 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -802,6 +802,25 @@ Q_SETQUOTA
Q_SYNC
RADIXCHAR
RAND_MAX
+RB_ASKNAME
+RB_SINGLE
+RB_NOSYNC
+RB_HALT
+RB_INITNAME
+RB_DFLTROOT
+RB_KDB
+RB_RDONLY
+RB_DUMP
+RB_MINIROOT
+RB_VERBOSE
+RB_SERIAL
+RB_CDROM
+RB_POWEROFF
+RB_GDB
+RB_MUTE
+RB_SELFTEST
+RB_PAUSE
+RB_VIDEO
REG_ASSERT
REG_ATOI
REG_BACKR
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt
index 19f6b614b5..77b35df6a1 100644
--- a/libc-test/semver/freebsd.txt
+++ b/libc-test/semver/freebsd.txt
@@ -1034,6 +1034,28 @@ Q_SETQUOTA
Q_SYNC
RADIXCHAR
RAND_MAX
+RB_ASKNAME
+RB_SINGLE
+RB_NOSYNC
+RB_HALT
+RB_INITNAME
+RB_DFLTROOT
+RB_KDB
+RB_RDONLY
+RB_DUMP
+RB_MINIROOT
+RB_VERBOSE
+RB_SERIAL
+RB_CDROM
+RB_POWEROFF
+RB_GDB
+RB_MUTE
+RB_SELFTEST
+RB_PAUSE
+RB_REROOT
+RB_POWERCYCLE
+RB_PROBE
+RB_MULTIPLE
REG_ASSERT
REG_ATOI
REG_BACKR
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index 72ea8c7504..d323a43540 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -1519,6 +1519,9 @@ pub const MAXCOMLEN: usize = 16;
pub const MAXLOGNAME: usize = 33;
pub const NGROUPS: usize = 16;
+pub const RB_PAUSE: ::c_int = 0x40000;
+pub const RB_VIDEO: ::c_int = 0x20000000;
+
const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + (::mem::size_of::<::c_long>() - 1)) & !(::mem::size_of::<::c_long>() - 1)
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 24c9316b58..f3dad2caa1 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -4683,6 +4683,12 @@ pub const SCTP_STREAM_CHANGE_FAILED: ::c_int = 0x0008;
pub const KENV_DUMP_LOADER: ::c_int = 4;
pub const KENV_DUMP_STATIC: ::c_int = 5;
+pub const RB_PAUSE: ::c_int = 0x100000;
+pub const RB_REROOT: ::c_int = 0x200000;
+pub const RB_POWERCYCLE: ::c_int = 0x400000;
+pub const RB_PROBE: ::c_int = 0x10000000;
+pub const RB_MULTIPLE: ::c_int = 0x20000000;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index d89d5f8ffe..f328f0dd76 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1441,6 +1441,24 @@ pub const KENV_DUMP: ::c_int = 3;
pub const KENV_MNAMELEN: ::c_int = 128;
pub const KENV_MVALLEN: ::c_int = 128;
+pub const RB_ASKNAME: ::c_int = 0x001;
+pub const RB_SINGLE: ::c_int = 0x002;
+pub const RB_NOSYNC: ::c_int = 0x004;
+pub const RB_HALT: ::c_int = 0x008;
+pub const RB_INITNAME: ::c_int = 0x010;
+pub const RB_DFLTROOT: ::c_int = 0x020;
+pub const RB_KDB: ::c_int = 0x040;
+pub const RB_RDONLY: ::c_int = 0x080;
+pub const RB_DUMP: ::c_int = 0x100;
+pub const RB_MINIROOT: ::c_int = 0x200;
+pub const RB_VERBOSE: ::c_int = 0x800;
+pub const RB_SERIAL: ::c_int = 0x1000;
+pub const RB_CDROM: ::c_int = 0x2000;
+pub const RB_POWEROFF: ::c_int = 0x4000;
+pub const RB_GDB: ::c_int = 0x8000;
+pub const RB_MUTE: ::c_int = 0x10000;
+pub const RB_SELFTEST: ::c_int = 0x20000;
+
safe_f! {
pub {const} fn WIFCONTINUED(status: ::c_int) -> bool {
status == 0x13
@@ -1751,6 +1769,7 @@ extern "C" {
value: *mut ::c_char,
len: ::c_int,
) -> ::c_int;
+ pub fn reboot(howto: ::c_int) -> ::c_int;
}
#[link(name = "rt")]