aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog51
-rw-r--r--conform/data/sys/ipc.h-data3
-rw-r--r--sysdeps/unix/sysv/linux/Makefile3
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/ipc.h54
-rw-r--r--sysdeps/unix/sysv/linux/alpha/bits/ipc.h54
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/Versions5
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/arm/kernel-features.h5
-rw-r--r--sysdeps/unix/sysv/linux/bits/ipc-perm.h40
-rw-r--r--sysdeps/unix/sysv/linux/bits/ipc.h17
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h37
-rw-r--r--sysdeps/unix/sysv/linux/hppa/bits/ipc.h62
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/ipc.h53
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h8
-rw-r--r--sysdeps/unix/sysv/linux/m68k/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/kernel-features.h1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/Versions5
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel-features.h5
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ipc.h54
-rw-r--r--sysdeps/unix/sysv/linux/msgctl.c56
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/ipc-perm.h (renamed from sysdeps/unix/sysv/linux/powerpc/bits/ipc.h)24
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/ipc.h60
-rw-r--r--sysdeps/unix/sysv/linux/s390/kernel-features.h3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/Versions3
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/semctl.c84
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/Versions5
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist3
-rw-r--r--sysdeps/unix/sysv/linux/sh/kernel-features.h5
-rw-r--r--sysdeps/unix/sysv/linux/shmctl.c60
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/ipc-perm.h (renamed from sysdeps/unix/sysv/linux/sparc/bits/ipc.h)31
34 files changed, 388 insertions, 421 deletions
diff --git a/ChangeLog b/ChangeLog
index 53ae72288f..6bf3462b58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,54 @@
+2019-10-10 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #18231]
+ * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
+ bits/ipc-perm.h.
+ * sysdeps/unix/sysv/linux/aarch64/bits/ipc.h: Remove file.
+ * sysdeps/unix/sysv/linux/alpha/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/hppa/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/mips/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/powerpc/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/ipc.h: Likewise.
+ * sysdeps/unix/sysv/linux/arm/kernel-features.h
+ [__BYTE_ORDER == __BIG_ENDIAN] (__ASSUME_SYSVIPC_BROKEN_MODE_T):
+ Define.
+ * sysdeps/sysv/linux/microblaze/kernel-features.h: Likewise.
+ * sysdeps/unix/sysv/linux/s390/kernel-features.h
+ [!__s390x__] (__ASSUME_SYSVIPC_BROKEN_MODE_T): Define.
+ * sysdeps/unix/sysv/linux/sh/kernel-features.h
+ (__ASSUME_SYSVIPC_BROKEN_MODE_T): Define.
+ * sysdeps/unix/sysv/linux/m68k/kernel-features.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/ipc-perm.h: New file.
+ * sysdeps/unix/sysv/linux/powerpc/bits/ipc-perm.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/ipc-perm.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/ipc.h (ipc_perm): Move to
+ bits/ipc-perm.h.
+ * sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h: New file.
+ * sysdeps/unix/sysv/linux/kernel-features.h: Add comment about
+ __ASSUME_SYSVIPC_BROKEN_MODE_T semantic.
+ * sysdeps/unix/sysv/linux/msgctl.c (DEFAULT_VERSION): Define as
+ 2.31 if __ASSUME_SYSVIPC_BROKEN_MODE_T is defined.
+ (msgctl_syscall, __msgctl_mode16): New symbol.
+ (__new_msgctl): Add bits for __ASSUME_SYSVIPC_BROKEN_MODE_T.
+ * sysdeps/unix/sysv/linux/semctl.c: Likewise.
+ * sysdeps/unix/sysv/linux/shmctl.c: Likewise.
+ * sysdeps/unix/sysv/linux/arm/be/libc.abilist (GLIBC_2.31): Add
+ msgctl, semctl, and shmctl.
+ * sysdeps/sysv/linux/microblaze/be/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
+ * sysdeps/unix/sysv/linux/sh/be/libc.abilist: Likewise.
+ * conform/data/sys/ipc.h-data: Only xfail {struct ipc_perm} mode_t
+ mode for Hurd.
+ * sysdeps/unix/sysv/linux/m68k/Versions (libc) [GLIBC_2.31]: Add
+ msgctl, semctl, and shmctl.
+ * sysdeps/unix/sysv/linux/arm/be/Versions: New file.
+ * sysdeps/unix/sysv/linux/microblaze/be/Versions: Likewise.
+ * sysdeps/unix/sysv/linux/sh/be/Versions: Likewise.
+
2019-10-10 Andreas Schwab <schwab@suse.de>
* elf/dl-load.c (open_verify): Remove dead code.
diff --git a/conform/data/sys/ipc.h-data b/conform/data/sys/ipc.h-data
index 09e8f68f8e..1364b07e87 100644
--- a/conform/data/sys/ipc.h-data
+++ b/conform/data/sys/ipc.h-data
@@ -6,8 +6,7 @@ xfail[i386-gnu]-element {struct ipc_perm} uid_t uid
xfail[i386-gnu]-element {struct ipc_perm} gid_t gid
xfail[i386-gnu]-element {struct ipc_perm} uid_t cuid
xfail[i386-gnu]-element {struct ipc_perm} gid_t cgid
-// Bug 18231: wrong type for mode member.
-xfail-element {struct ipc_perm} mode_t mode
+xfail[i386-gnu]-element {struct ipc_perm} mode_t mode
type uid_t
type gid_t
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 7203581e2f..0e09d61a7a 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -48,7 +48,8 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/termios-c_iflag.h bits/termios-c_oflag.h \
bits/termios-baud.h bits/termios-c_cflag.h \
bits/termios-c_lflag.h bits/termios-tcflow.h \
- bits/termios-misc.h
+ bits/termios-misc.h \
+ bits/ipc-perm.h
tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h b/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h
deleted file mode 100644
index a58c8980b5..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/bits/ipc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IPC_H
-# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* Mode bits for `msgget', `semget', and `shmget'. */
-#define IPC_CREAT 01000 /* Create key if key does not exist. */
-#define IPC_EXCL 02000 /* Fail if key exists. */
-#define IPC_NOWAIT 04000 /* Return error on wait. */
-
-/* Control commands for `msgctl', `semctl', and `shmctl'. */
-#define IPC_RMID 0 /* Remove identifier. */
-#define IPC_SET 1 /* Set `ipc_perm' options. */
-#define IPC_STAT 2 /* Get `ipc_perm' options. */
-#ifdef __USE_GNU
-# define IPC_INFO 3 /* See ipcs. */
-#endif
-
-/* Special key values. */
-#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
-
-
-/* Data structure used to pass permission information to IPC operations. */
-struct ipc_perm
- {
- __key_t __key; /* Key. */
- __uid_t uid; /* Owner's user ID. */
- __gid_t gid; /* Owner's group ID. */
- __uid_t cuid; /* Creator's user ID. */
- __gid_t cgid; /* Creator's group ID. */
- unsigned int mode; /* Read/write permission. */
- unsigned short int __seq; /* Sequence number. */
- unsigned short int __pad1;
- __syscall_ulong_t __glibc_reserved1;
- __syscall_ulong_t __glibc_reserved2;
- };
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h b/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
deleted file mode 100644
index 71cf2d5160..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/bits/ipc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IPC_H
-# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
-#endif
-
-#include <bits/types.h>
-
-/* Mode bits for `msgget', `semget', and `shmget'. */
-#define IPC_CREAT 01000 /* Create key if key does not exist. */
-#define IPC_EXCL 02000 /* Fail if key exists. */
-#define IPC_NOWAIT 04000 /* Return error on wait. */
-
-/* Control commands for `msgctl', `semctl', and `shmctl'. */
-#define IPC_RMID 0 /* Remove identifier. */
-#define IPC_SET 1 /* Set `ipc_perm' options. */
-#define IPC_STAT 2 /* Get `ipc_perm' options. */
-#ifdef __USE_GNU
-# define IPC_INFO 3 /* See ipcs. */
-#endif
-
-/* Special key values. */
-#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
-
-
-/* Data structure used to pass permission information to IPC operations. */
-struct ipc_perm
- {
- __key_t __key; /* Key. */
- unsigned int uid; /* Owner's user ID. */
- unsigned int gid; /* Owner's group ID. */
- unsigned int cuid; /* Creator's user ID. */
- unsigned int cgid; /* Creator's group ID. */
- unsigned int mode; /* Read/write permission. */
- unsigned short int __seq; /* Sequence number. */
- unsigned short int __pad1;
- unsigned long int __glibc_reserved1;
- unsigned long int __glibc_reserved2;
- };
diff --git a/sysdeps/unix/sysv/linux/arm/be/Versions b/sysdeps/unix/sysv/linux/arm/be/Versions
new file mode 100644
index 0000000000..a50cd57630
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arm/be/Versions
@@ -0,0 +1,5 @@
+libc {
+ GLIBC_2.31 {
+ msgctl; semctl; shmctl;
+ }
+}
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 9371927927..b152c0e24a 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -130,6 +130,9 @@ GLIBC_2.30 getdents64 F
GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
+GLIBC_2.31 msgctl F
+GLIBC_2.31 semctl F
+GLIBC_2.31 shmctl F
GLIBC_2.4 _Exit F
GLIBC_2.4 _IO_2_1_stderr_ D 0xa0
GLIBC_2.4 _IO_2_1_stdin_ D 0xa0
diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h
index 3befa92b57..6b32970e2b 100644
--- a/sysdeps/unix/sysv/linux/arm/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h
@@ -17,6 +17,7 @@
License along with the GNU C Library. If not, see
<https://www.gnu.org/licenses/>. */
+#include <endian.h>
#include_next <kernel-features.h>
/* The ARM kernel before 3.14.3 may or may not support
@@ -49,3 +50,7 @@
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS 1
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+# define __ASSUME_SYSVIPC_BROKEN_MODE_T
+#endif
diff --git a/sysdeps/unix/sysv/linux/bits/ipc-perm.h b/sysdeps/unix/sysv/linux/bits/ipc-perm.h
new file mode 100644
index 0000000000..2c3f49f292
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/bits/ipc-perm.h
@@ -0,0 +1,40 @@
+/* struct ipc_perm definition.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead."
+#endif
+
+/* Data structure used to pass permission information to IPC operations.
+ It follows the kernel ipc64_perm size so the syscall can be made directly
+ without temporary buffer copy. However, since glibc defines the MODE
+ field as mode_t per POSIX definition (BZ#18231), it omits the __PAD1 field
+ (since glibc does not export mode_t as 16-bit for any architecture). */
+struct ipc_perm
+{
+ __key_t __key; /* Key. */
+ __uid_t uid; /* Owner's user ID. */
+ __gid_t gid; /* Owner's group ID. */
+ __uid_t cuid; /* Creator's user ID. */
+ __gid_t cgid; /* Creator's group ID. */
+ __mode_t mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+ unsigned short int __pad2;
+ __syscall_ulong_t __glibc_reserved1;
+ __syscall_ulong_t __glibc_reserved2;
+};
diff --git a/sysdeps/unix/sysv/linux/bits/ipc.h b/sysdeps/unix/sysv/linux/bits/ipc.h
index 652369cb8d..9939857ab5 100644
--- a/sysdeps/unix/sysv/linux/bits/ipc.h
+++ b/sysdeps/unix/sysv/linux/bits/ipc.h
@@ -37,19 +37,4 @@
/* Special key values. */
#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
-
-/* Data structure used to pass permission information to IPC operations. */
-struct ipc_perm
- {
- __key_t __key; /* Key. */
- __uid_t uid; /* Owner's user ID. */
- __gid_t gid; /* Owner's group ID. */
- __uid_t cuid; /* Creator's user ID. */
- __gid_t cgid; /* Creator's group ID. */
- unsigned short int mode; /* Read/write permission. */
- unsigned short int __pad1;
- unsigned short int __seq; /* Sequence number. */
- unsigned short int __pad2;
- __syscall_ulong_t __glibc_reserved1;
- __syscall_ulong_t __glibc_reserved2;
- };
+#include <bits/ipc-perm.h>
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h b/sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h
new file mode 100644
index 0000000000..f29fc1689c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/hppa/bits/ipc-perm.h
@@ -0,0 +1,37 @@
+/* struct ipc_perm definition.
+ Copyright (C) 2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc-perm.h> directly; include <sys/ipc.h> instead."
+#endif
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ __uid_t uid; /* Owner's user ID. */
+ __gid_t gid; /* Owner's group ID. */
+ __uid_t cuid; /* Creator's user ID. */
+ __gid_t cgid; /* Creator's group ID. */
+ __mode_t mode; /* Read/write permission. */
+ unsigned short int __pad2;
+ unsigned short int __seq; /* Sequence number. */
+ unsigned int __pad3;
+ __extension__ unsigned long long int __glibc_reserved1;
+ __extension__ unsigned long long int __glibc_reserved2;
+ };
diff --git a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h b/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
deleted file mode 100644
index b7ae38da70..0000000000
--- a/sysdeps/unix/sysv/linux/hppa/bits/ipc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Copyright (C) 1995-2019 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library. If not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_IPC_H
-# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
-#endif
-
-#include <bits/types.h>
-#include <bits/wordsize.h>
-
-/* Mode bits for `msgget', `semget', and `shmget'. */
-