about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sparc
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-05-15 15:20:58 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-10-17 11:04:59 -0300
commit06436acf819d9e6ada7be3ca977d5c0a23d3f138 (patch)
treec1fa0e3ac981c845d83b2cd985c563c7059f55e9 /sysdeps/unix/sysv/linux/sparc
parent7d3db434f910c23591f748a6d0ac3548af1048bb (diff)
downloadglibc-06436acf819d9e6ada7be3ca977d5c0a23d3f138.tar.gz
glibc-06436acf819d9e6ada7be3ca977d5c0a23d3f138.tar.xz
glibc-06436acf819d9e6ada7be3ca977d5c0a23d3f138.zip
ipc: Refactor sysvipc internal definitions
This patch refactor the internal sysvipc in two main points:

  1. Add a new __ASSUME_SYSVIPC_DEFAULT_IPC_64 to infer the __IPC_64
     value to be used along either the multiplexed __NR_ipc or wired-up
     syscall.  The defaut value assumed for __IPC_64 is also changed
     from 0x100 to 0x0, aligning with Linux generic UAPI.  The idea
     is to simplify the Linux 5.1 wire-up for sysvipc syscalls for
     some 32-bit ABIs (which expectes __IPC_64 being 0x0) and simplify
     new ports (which will no longer need to add ipc_priv.h).

  2. It also removes some duplicated internal definition used on compat
     sysvipc symbols defined at ipc_priv.h (more specifically the
     __old_ipc_perm, SEMCTL_ARG_ADDRESS, MSGRCV_ARGS, and
     SEMTIMEDOP_IPC_ARGS).  The idea is also to make it simpler to enable
     the new wire-up sysvipc syscall provided by Linux v5.1.

There is no semantic change expected on any port.  Checked with a build
against all affected ABIs.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps/unix/sysv/linux/sparc')
-rw-r--r--sysdeps/unix/sysv/linux/sparc/kernel-features.h3
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h19
2 files changed, 8 insertions, 14 deletions
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index c523461d95..25194117f6 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -60,6 +60,9 @@
 
 /* sparc only supports ipc syscall.  */
 #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+#ifndef __arch64__
+# undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
+#endif
 
 /* Support for the renameat2 syscall was added in 3.16.  */
 #if __LINUX_KERNEL_VERSION < 0x031000
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
index 00f8510056..0443d6b672 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h
@@ -16,26 +16,17 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <sys/ipc.h>  /* For __key_t  */
-
-#define __IPC_64	0x0
-
-struct __old_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.  */
-};
+#define __OLD_IPC_ID_TYPE   unsigned int
+#define __OLD_IPC_MODE_TYPE unsigned int
+#include <sysdeps/unix/sysv/linux/ipc_priv.h>
 
 /* SPARC semctl multiplex syscall expects the union pointed address, not
    the union address itself.  */
+#undef SEMCTL_ARG_ADDRESS
 #define SEMCTL_ARG_ADDRESS(__arg) __arg.array
 
 /* Also for msgrcv it does not use the kludge on final 2 arguments.  */
+#undef MSGRCV_ARGS
 #define MSGRCV_ARGS(__msgp, __msgtyp) __msgp, __msgtyp
 
 #define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \