diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index b035661d59b21..753a72f724a34 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -1391,6 +1391,10 @@ settimeofday setutxdb setutxent sf_hdtr +shmat +shmctl +shmdt +shmget sigaltstack sigevent siginfo_t diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index 7a620f38861e7..0eaac540101d6 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -18,6 +18,7 @@ pub type uuid_t = ::uuid; pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type idtype_t = ::c_uint; +pub type shmatt_t = ::c_uint; pub type mqd_t = ::c_int; pub type sem_t = *mut sem; @@ -197,6 +198,18 @@ s! { pub struct cpumask_t { ary: [u64; 4], } + + pub struct shmid_ds { + pub shm_perm: ::ipc_perm, + pub shm_segsz: ::size_t, + pub shm_lpid: ::pid_t, + pub shm_cpid: ::pid_t, + pub shm_nattch: ::shmatt_t, + pub shm_atime: ::time_t, + pub shm_dtime: ::time_t, + pub shm_ctime: ::time_t, + shm_internal: *mut ::c_void, + } } s_no_extra_traits! { @@ -1283,6 +1296,11 @@ extern "C" { pub fn sched_setaffinity(pid: ::pid_t, cpusetsize: ::size_t, mask: *const cpu_set_t) -> ::c_int; pub fn setproctitle(fmt: *const ::c_char, ...); + + pub fn shmget(key: ::key_t, size: ::size_t, shmflg: ::c_int) -> ::c_int; + pub fn shmat(shmid: ::c_int, shmaddr: *const ::c_void, shmflg: ::c_int) -> *mut ::c_void; + pub fn shmdt(shmaddr: *const ::c_void) -> ::c_int; + pub fn shmctl(shmid: ::c_int, cmd: ::c_int, buf: *mut ::shmid_ds) -> ::c_int; } #[link(name = "rt")] diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 23a5e62603139..f5a2469174f2f 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -71,16 +71,6 @@ s! { data: [u32; 4], } - pub struct ipc_perm { - pub cuid: ::uid_t, - pub cgid: ::gid_t, - pub uid: ::uid_t, - pub gid: ::gid_t, - pub mode: ::mode_t, - pub seq: ::c_ushort, - pub key: ::key_t, - } - pub struct msqid_ds { pub msg_perm: ::ipc_perm, __unused1: *mut ::c_void, diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index bed49c907ed63..43cebd6842824 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -345,6 +345,16 @@ s! { pub dlpi_tls_modid: usize, pub dlpi_tls_data: *mut ::c_void, } + + pub struct ipc_perm { + pub cuid: ::uid_t, + pub cgid: ::gid_t, + pub uid: ::uid_t, + pub gid: ::gid_t, + pub mode: ::mode_t, + pub seq: ::c_ushort, + pub key: ::key_t, + } } s_no_extra_traits! {