1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

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>
This commit is contained in:
Adhemerval Zanella
2019-05-15 15:20:58 -03:00
parent 7d3db434f9
commit 06436acf81
22 changed files with 56 additions and 192 deletions

View File

@@ -17,17 +17,29 @@
<https://www.gnu.org/licenses/>. */
#include <sys/ipc.h> /* For __key_t */
#include <kernel-features.h>
#define __IPC_64 0x100
#ifdef __ASSUME_SYSVIPC_DEFAULT_IPC_64
# define __IPC_64 0x0
#else
# define __IPC_64 0x100
#endif
#ifndef __OLD_IPC_ID_TYPE
# define __OLD_IPC_ID_TYPE unsigned short int
#endif
#ifndef __OLD_IPC_MODE_TYPE
# define __OLD_IPC_MODE_TYPE unsigned short int
#endif
struct __old_ipc_perm
{
__key_t __key; /* Key. */
unsigned short int uid; /* Owner's user ID. */
unsigned short int gid; /* Owner's group ID. */
unsigned short int cuid; /* Creator's user ID. */
unsigned short int cgid; /* Creator's group ID. */
unsigned short int mode; /* Read/write permission. */
__OLD_IPC_ID_TYPE uid; /* Owner's user ID. */
__OLD_IPC_ID_TYPE gid; /* Owner's group ID. */
__OLD_IPC_ID_TYPE cuid; /* Creator's user ID. */
__OLD_IPC_ID_TYPE cgid; /* Creator's group ID. */
__OLD_IPC_MODE_TYPE mode; /* Read/write permission. */
unsigned short int __seq; /* Sequence number. */
};