summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2021-08-07 15:01:28 +0100
committerDC <devnexen@gmail.com>2021-08-08 16:29:56 +0100
commitdcdd33223de81d5dd121721e4e26a3ef0ce6e170 (patch)
treed86a3ec9f6a3db7d04274aeb75df7574d856ef46
parente02b7e5c1d894c53d206a7c348f00d32fd995685 (diff)
downloadrust-libc-dcdd33223de81d5dd121721e4e26a3ef0ce6e170.tar.gz
netbsd/openbsd adding more IPC_* flags.
SHM flags, albeit obsolete, are used in couple of crates.
-rwxr-xr-xlibc-test/build.rs4
-rw-r--r--libc-test/semver/dragonfly.txt14
-rw-r--r--libc-test/semver/netbsd.txt5
-rw-r--r--libc-test/semver/openbsd.txt5
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs15
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs17
-rw-r--r--src/unix/bsd/netbsdlike/mod.rs7
7 files changed, 52 insertions, 15 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index e91a55fece..825879ce30 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 1cefa749c1..e51c81f922 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 d4d83a1d5b..dd9ccdb8ad 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 240192d92a..9b2a9be272 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 338d986c50..23a5e62603 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 59ebf8f2bc..bed49c907e 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 e7e376309b..6da25ca34a 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;