diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 20efcf664696a..564d4eb36c311 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -771,6 +771,12 @@ POSIX_MADV_NORMAL POSIX_MADV_RANDOM POSIX_MADV_SEQUENTIAL POSIX_MADV_WILLNEED +POSIX_SPAWN_RESETIDS +POSIX_SPAWN_SETPGROUP +POSIX_SPAWN_SETSCHEDPARAM +POSIX_SPAWN_SETSCHEDULER +POSIX_SPAWN_SETSIGDEF +POSIX_SPAWN_SETSIGMASK PPPDISC PROC_PDEATHSIG_CTL PROC_PDEATHSIG_STATUS @@ -1434,6 +1440,8 @@ mincore mkdirat mkfifoat mknodat +mkostemp +mkostemps mkstemps mq_attr mq_close @@ -1468,6 +1476,29 @@ popen posix_fadvise posix_fallocate posix_madvise +posix_spawn +posix_spawn_file_actions_addclose +posix_spawn_file_actions_adddup2 +posix_spawn_file_actions_addopen +posix_spawn_file_actions_destroy +posix_spawn_file_actions_init +posix_spawn_file_actions_t +posix_spawnattr_destroy +posix_spawnattr_getflags +posix_spawnattr_getpgroup +posix_spawnattr_getschedparam +posix_spawnattr_getschedpolicy +posix_spawnattr_getsigdefault +posix_spawnattr_getsigmask +posix_spawnattr_init +posix_spawnattr_setflags +posix_spawnattr_setpgroup +posix_spawnattr_setschedparam +posix_spawnattr_setschedpolicy +posix_spawnattr_setsigdefault +posix_spawnattr_setsigmask +posix_spawnattr_t +posix_spawnp ppoll preadv procctl diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 2b84898c7068d..0bea4dc7b8c85 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -26,8 +26,6 @@ pub type cpulevel_t = c_int; pub type cpuwhich_t = c_int; pub type mqd_t = *mut c_void; -pub type posix_spawnattr_t = *mut c_void; -pub type posix_spawn_file_actions_t = *mut c_void; pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock; pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr; @@ -3938,13 +3936,6 @@ pub const RTP_PRIO_REALTIME: c_ushort = 2; pub const RTP_PRIO_NORMAL: c_ushort = 3; pub const RTP_PRIO_IDLE: c_ushort = 4; -pub const POSIX_SPAWN_RESETIDS: c_short = 0x01; -pub const POSIX_SPAWN_SETPGROUP: c_short = 0x02; -pub const POSIX_SPAWN_SETSCHEDPARAM: c_short = 0x04; -pub const POSIX_SPAWN_SETSCHEDULER: c_short = 0x08; -pub const POSIX_SPAWN_SETSIGDEF: c_short = 0x10; -pub const POSIX_SPAWN_SETSIGMASK: c_short = 0x20; - // Flags for chflags(2) pub const UF_SYSTEM: c_ulong = 0x00000080; pub const UF_SPARSE: c_ulong = 0x00000100; @@ -5160,9 +5151,6 @@ extern "C" { sevp: *mut sigevent, ) -> c_int; - pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; - pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; - pub fn getutxuser(user: *const c_char) -> *mut utmpx; pub fn setutxdb(_type: c_int, file: *const c_char) -> c_int; @@ -5196,80 +5184,6 @@ extern "C" { pub fn rtprio_thread(function: c_int, lwpid: crate::lwpid_t, rtp: *mut super::rtprio) -> c_int; - pub fn posix_spawn( - pid: *mut crate::pid_t, - path: *const c_char, - file_actions: *const crate::posix_spawn_file_actions_t, - attrp: *const crate::posix_spawnattr_t, - argv: *const *mut c_char, - envp: *const *mut c_char, - ) -> c_int; - pub fn posix_spawnp( - pid: *mut crate::pid_t, - file: *const c_char, - file_actions: *const crate::posix_spawn_file_actions_t, - attrp: *const crate::posix_spawnattr_t, - argv: *const *mut c_char, - envp: *const *mut c_char, - ) -> c_int; - pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int; - pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int; - pub fn posix_spawnattr_getsigdefault( - attr: *const posix_spawnattr_t, - default: *mut crate::sigset_t, - ) -> c_int; - pub fn posix_spawnattr_setsigdefault( - attr: *mut posix_spawnattr_t, - default: *const crate::sigset_t, - ) -> c_int; - pub fn posix_spawnattr_getsigmask( - attr: *const posix_spawnattr_t, - default: *mut crate::sigset_t, - ) -> c_int; - pub fn posix_spawnattr_setsigmask( - attr: *mut posix_spawnattr_t, - default: *const crate::sigset_t, - ) -> c_int; - pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int; - pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int; - pub fn posix_spawnattr_getpgroup( - attr: *const posix_spawnattr_t, - flags: *mut crate::pid_t, - ) -> c_int; - pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; - pub fn posix_spawnattr_getschedpolicy( - attr: *const posix_spawnattr_t, - flags: *mut c_int, - ) -> c_int; - pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; - pub fn posix_spawnattr_getschedparam( - attr: *const posix_spawnattr_t, - param: *mut crate::sched_param, - ) -> c_int; - pub fn posix_spawnattr_setschedparam( - attr: *mut posix_spawnattr_t, - param: *const crate::sched_param, - ) -> c_int; - - pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; - pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; - pub fn posix_spawn_file_actions_addopen( - actions: *mut posix_spawn_file_actions_t, - fd: c_int, - path: *const c_char, - oflag: c_int, - mode: crate::mode_t, - ) -> c_int; - pub fn posix_spawn_file_actions_addclose( - actions: *mut posix_spawn_file_actions_t, - fd: c_int, - ) -> c_int; - pub fn posix_spawn_file_actions_adddup2( - actions: *mut posix_spawn_file_actions_t, - fd: c_int, - newfd: c_int, - ) -> c_int; - pub fn uuidgen(store: *mut uuid, count: c_int) -> c_int; pub fn thr_kill(id: c_long, sig: c_int) -> c_int; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index e172db7e4e1a3..99dda9d30806f 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -42,6 +42,9 @@ pub type iconv_t = *mut c_void; // making the type definition system dependent. Better not bind it exactly. pub type kvm_t = c_void; +pub type posix_spawnattr_t = *mut c_void; +pub type posix_spawn_file_actions_t = *mut c_void; + cfg_if! { if #[cfg(target_pointer_width = "64")] { type Elf_Addr = Elf64_Addr; @@ -1481,6 +1484,13 @@ pub const GRND_NONBLOCK: c_uint = 0x1; pub const GRND_RANDOM: c_uint = 0x2; pub const GRND_INSECURE: c_uint = 0x4; +pub const POSIX_SPAWN_RESETIDS: c_short = 0x01; +pub const POSIX_SPAWN_SETPGROUP: c_short = 0x02; +pub const POSIX_SPAWN_SETSCHEDPARAM: c_short = 0x04; +pub const POSIX_SPAWN_SETSCHEDULER: c_short = 0x08; +pub const POSIX_SPAWN_SETSIGDEF: c_short = 0x10; +pub const POSIX_SPAWN_SETSIGMASK: c_short = 0x20; + safe_f! { pub {const} fn WIFCONTINUED(status: c_int) -> bool { status == 0x13 @@ -1792,6 +1802,83 @@ extern "C" { search_path: *const c_char, argv: *const *mut c_char, ) -> c_int; + + pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; + pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; + + pub fn posix_spawn( + pid: *mut crate::pid_t, + path: *const c_char, + file_actions: *const crate::posix_spawn_file_actions_t, + attrp: *const crate::posix_spawnattr_t, + argv: *const *mut c_char, + envp: *const *mut c_char, + ) -> c_int; + pub fn posix_spawnp( + pid: *mut crate::pid_t, + file: *const c_char, + file_actions: *const crate::posix_spawn_file_actions_t, + attrp: *const crate::posix_spawnattr_t, + argv: *const *mut c_char, + envp: *const *mut c_char, + ) -> c_int; + pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int; + pub fn posix_spawnattr_destroy(attr: *mut posix_spawnattr_t) -> c_int; + pub fn posix_spawnattr_getsigdefault( + attr: *const posix_spawnattr_t, + default: *mut crate::sigset_t, + ) -> c_int; + pub fn posix_spawnattr_setsigdefault( + attr: *mut posix_spawnattr_t, + default: *const crate::sigset_t, + ) -> c_int; + pub fn posix_spawnattr_getsigmask( + attr: *const posix_spawnattr_t, + default: *mut crate::sigset_t, + ) -> c_int; + pub fn posix_spawnattr_setsigmask( + attr: *mut posix_spawnattr_t, + default: *const crate::sigset_t, + ) -> c_int; + pub fn posix_spawnattr_getflags(attr: *const posix_spawnattr_t, flags: *mut c_short) -> c_int; + pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int; + pub fn posix_spawnattr_getpgroup( + attr: *const posix_spawnattr_t, + flags: *mut crate::pid_t, + ) -> c_int; + pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; + pub fn posix_spawnattr_getschedpolicy( + attr: *const posix_spawnattr_t, + flags: *mut c_int, + ) -> c_int; + pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; + pub fn posix_spawnattr_getschedparam( + attr: *const posix_spawnattr_t, + param: *mut crate::sched_param, + ) -> c_int; + pub fn posix_spawnattr_setschedparam( + attr: *mut posix_spawnattr_t, + param: *const crate::sched_param, + ) -> c_int; + + pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; + pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; + pub fn posix_spawn_file_actions_addopen( + actions: *mut posix_spawn_file_actions_t, + fd: c_int, + path: *const c_char, + oflag: c_int, + mode: crate::mode_t, + ) -> c_int; + pub fn posix_spawn_file_actions_addclose( + actions: *mut posix_spawn_file_actions_t, + fd: c_int, + ) -> c_int; + pub fn posix_spawn_file_actions_adddup2( + actions: *mut posix_spawn_file_actions_t, + fd: c_int, + newfd: c_int, + ) -> c_int; } #[link(name = "rt")]