diff --git a/libc-test/build.rs b/libc-test/build.rs index e91a55fece567..825879ce30759 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -422,6 +422,7 @@ fn test_openbsd(target: &str) { "sys/ioctl.h", "sys/mman.h", "sys/resource.h", + "sys/shm.h", "sys/socket.h", "sys/time.h", "sys/un.h", @@ -960,6 +961,7 @@ fn test_netbsd(target: &str) { "sys/mount.h", "sys/ptrace.h", "sys/resource.h", + "sys/shm.h", "sys/socket.h", "sys/statvfs.h", "sys/sysctl.h", @@ -1167,12 +1169,14 @@ fn test_dragonflybsd(target: &str) { "sys/event.h", "sys/file.h", "sys/ioctl.h", + "sys/ipc.h", "sys/mman.h", "sys/mount.h", "sys/ptrace.h", "sys/resource.h", "sys/rtprio.h", "sys/sched.h", + "sys/shm.h", "sys/socket.h", "sys/stat.h", "sys/statvfs.h", diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt index 1cefa749c1f77..e51c81f9221cd 100644 --- a/libc-test/semver/dragonfly.txt +++ b/libc-test/semver/dragonfly.txt @@ -341,6 +341,16 @@ IFF_STATICARP IFF_UP INIT_PROCESS IOV_MAX +IPC_CREAT +IPC_EXCL +IPC_M +IPC_NOWAIT +IPC_PRIVATE +IPC_R +IPC_RMID +IPC_SET +IPC_STAT +IPC_W IPPROTO_3PC IPPROTO_ADFS IPPROTO_AH @@ -827,6 +837,10 @@ SF_NOHISTORY SF_NOUNLINK SF_SETTABLE SF_XLINK +SHM_R +SHM_RDONLY +SHM_RND +SHM_W SIGEMT SIGEV_KEVENT SIGEV_NONE diff --git a/libc-test/semver/netbsd.txt b/libc-test/semver/netbsd.txt index d4d83a1d5b60b..dd9ccdb8add19 100644 --- a/libc-test/semver/netbsd.txt +++ b/libc-test/semver/netbsd.txt @@ -351,11 +351,14 @@ INIT_PROCESS IOV_MAX IPC_CREAT IPC_EXCL +IPC_M IPC_NOWAIT IPC_PRIVATE +IPC_R IPC_RMID IPC_SET IPC_STAT +IPC_W IPPROTO_AH IPPROTO_CARP IPPROTO_DCCP @@ -800,6 +803,8 @@ SF_LOG SF_SETTABLE SF_SNAPINVAL SF_SNAPSHOT +SHM_R +SHM_W SIGEMT SIGEV_NONE SIGEV_SIGNAL diff --git a/libc-test/semver/openbsd.txt b/libc-test/semver/openbsd.txt index 240192d92a4c9..9b2a9be272acd 100644 --- a/libc-test/semver/openbsd.txt +++ b/libc-test/semver/openbsd.txt @@ -242,11 +242,14 @@ IFF_UP IOV_MAX IPC_CREAT IPC_EXCL +IPC_M IPC_NOWAIT IPC_PRIVATE +IPC_R IPC_RMID IPC_SET IPC_STAT +IPC_W IPPROTO_AH IPPROTO_CARP IPPROTO_DIVERT @@ -670,6 +673,8 @@ SF_APPEND SF_ARCHIVED SF_IMMUTABLE SF_SETTABLE +SHM_R +SHM_W SIGEMT SIGINFO SIGSTKSZ diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 338d986c50545..23a5e62603139 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -10,7 +10,6 @@ pub type fsblkcnt_t = u64; pub type fsfilcnt_t = u64; pub type idtype_t = ::c_uint; -pub type key_t = ::c_long; pub type msglen_t = ::c_ulong; pub type msgqnum_t = ::c_ulong; @@ -1176,22 +1175,8 @@ pub const NET_RT_IFMALIST: ::c_int = 4; pub const NET_RT_IFLISTL: ::c_int = 5; // System V IPC -pub const IPC_PRIVATE: ::key_t = 0; -pub const IPC_CREAT: ::c_int = 0o1000; -pub const IPC_EXCL: ::c_int = 0o2000; -pub const IPC_NOWAIT: ::c_int = 0o4000; -pub const IPC_RMID: ::c_int = 0; -pub const IPC_SET: ::c_int = 1; -pub const IPC_STAT: ::c_int = 2; pub const IPC_INFO: ::c_int = 3; -pub const IPC_R: ::c_int = 0o400; -pub const IPC_W: ::c_int = 0o200; -pub const IPC_M: ::c_int = 0o10000; pub const MSG_NOERROR: ::c_int = 0o10000; -pub const SHM_RDONLY: ::c_int = 0o10000; -pub const SHM_RND: ::c_int = 0o20000; -pub const SHM_R: ::c_int = 0o400; -pub const SHM_W: ::c_int = 0o200; pub const SHM_LOCK: ::c_int = 11; pub const SHM_UNLOCK: ::c_int = 12; pub const SHM_STAT: ::c_int = 13; diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index 59ebf8f2bca74..bed49c907ed63 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -13,6 +13,7 @@ pub type speed_t = ::c_uint; pub type nl_item = ::c_int; pub type id_t = i64; pub type vm_size_t = ::uintptr_t; +pub type key_t = ::c_long; // elf.h @@ -1358,6 +1359,22 @@ pub const TIME_ERROR: ::c_int = 5; pub const REG_ENOSYS: ::c_int = -1; pub const REG_ILLSEQ: ::c_int = 17; +pub const IPC_PRIVATE: ::key_t = 0; +pub const IPC_CREAT: ::c_int = 0o1000; +pub const IPC_EXCL: ::c_int = 0o2000; +pub const IPC_NOWAIT: ::c_int = 0o4000; +pub const IPC_RMID: ::c_int = 0; +pub const IPC_SET: ::c_int = 1; +pub const IPC_STAT: ::c_int = 2; +pub const IPC_R: ::c_int = 0o400; +pub const IPC_W: ::c_int = 0o200; +pub const IPC_M: ::c_int = 0o10000; + +pub const SHM_RDONLY: ::c_int = 0o10000; +pub const SHM_RND: ::c_int = 0o20000; +pub const SHM_R: ::c_int = 0o400; +pub const SHM_W: ::c_int = 0o200; + safe_f! { pub {const} fn WIFCONTINUED(status: ::c_int) -> bool { status == 0x13 diff --git a/src/unix/bsd/netbsdlike/mod.rs b/src/unix/bsd/netbsdlike/mod.rs index e7e376309bca2..6da25ca34a134 100644 --- a/src/unix/bsd/netbsdlike/mod.rs +++ b/src/unix/bsd/netbsdlike/mod.rs @@ -238,6 +238,13 @@ pub const IPC_RMID: ::c_int = 0; pub const IPC_SET: ::c_int = 1; pub const IPC_STAT: ::c_int = 2; +pub const IPC_R: ::c_int = 0o000400; +pub const IPC_W: ::c_int = 0o000200; +pub const IPC_M: ::c_int = 0o010000; + +pub const SHM_R: ::c_int = IPC_R; +pub const SHM_W: ::c_int = IPC_W; + pub const MCL_CURRENT: ::c_int = 0x0001; pub const MCL_FUTURE: ::c_int = 0x0002;