@@ -16,17 +16,7 @@
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 0x100
-
-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
+#define __OLD_IPC_SEQ_TYPE unsigned short int
+#include <sysdeps/unix/sysv/linux/ipc_priv.h>
@@ -52,4 +52,7 @@
# undef __ASSUME_STATX
#endif
+/* Alpha support old sysvipc even being a 64-bit architecture. */
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
+
#endif /* _KERNEL_FEATURES_H */
@@ -54,3 +54,5 @@
#if __BYTE_ORDER == __BIG_ENDIAN
# define __ASSUME_SYSVIPC_BROKEN_MODE_T
#endif
+
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
deleted file mode 100644
@@ -1,21 +0,0 @@
-/* Old SysV permission definition for Linux. Hppa version.
- Copyright (C) 2017-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/>. */
-
-#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x0
@@ -45,6 +45,7 @@
/* i686 only supports ipc syscall. */
#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS 1
deleted file mode 100644
@@ -1,21 +0,0 @@
-/* Old SysV permission definition for Linux. IA64 version.
- Copyright (C) 2017-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/>. */
-
-#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x0
@@ -17,18 +17,33 @@
<https://www.gnu.org/licenses/>. */
#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x100
+#include <kernel-features.h>
+
+#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
+#ifndef __OLD_IPC_SEQ_TYPE
+# define __OLD_IPC_SEQ_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. */
- unsigned short int __seq; /* Sequence number. */
+ __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. */
+ __OLD_IPC_SEQ_TYPE __seq; /* Sequence number. */
};
#define SEMCTL_ARG_ADDRESS(__arg) &__arg.array
@@ -85,6 +85,9 @@
/* Support for SysV IPC through wired syscalls. All supported architectures
either support ipc syscall and/or all the ipc correspondent syscalls. */
#define __ASSUME_DIRECT_SYSVIPC_SYSCALLS 1
+/* The generic default __IPC_64 value is 0x0, however some architectures
+ require a different value of 0x100. */
+#define __ASSUME_SYSVIPC_DEFAULT_IPC_64 1
/* All supported architectures reserve a 32-bit for MODE field in sysvipc
ipc_perm. However, some kernel ABI interfaces still expect a 16-bit
@@ -53,3 +53,4 @@
/* m68k only supports ipc syscall. */
#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
#define __ASSUME_SYSVIPC_BROKEN_MODE_T
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
@@ -72,3 +72,4 @@
#if __BYTE_ORDER == __BIG_ENDIAN
# define __ASSUME_SYSVIPC_BROKEN_MODE_T
#endif
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
@@ -50,3 +50,5 @@
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS 1
+
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
@@ -16,17 +16,7 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <sys/ipc.h>
-
-#define __IPC_64 0x100
-
-struct __old_ipc_perm
-{
- __key_t __key; /* Key. */
- int uid; /* Owner's user ID. */
- int gid; /* Owner's group ID. */
- int cuid; /* Creator's user ID. */
- int cgid; /* Creator's group ID. */
- int mode; /* Read/write permission. */
- unsigned short int __seq; /* Sequence number. */
-};
+#define __OLD_IPC_ID_TYPE int
+#define __OLD_IPC_MODE_TYPE int
+#define __OLD_IPC_SEQ_TYPE unsigned short int
+#include <sysdeps/unix/sysv/linux/ipc_priv.h>
deleted file mode 100644
@@ -1,21 +0,0 @@
-/* Old SysV permission definition for Linux. Nios II version.
- Copyright (C) 2017-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/>. */
-
-#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x0
similarity index 75%
rename from sysdeps/unix/sysv/linux/csky/ipc_priv.h
rename to sysdeps/unix/sysv/linux/nios2/kernel-features.h
@@ -1,5 +1,6 @@
-/* Old SysV permission definition for Linux. C-SKY version.
- Copyright (C) 2017-2019 Free Software Foundation, Inc.
+/* Set flags signalling availability of kernel features based on given
+ kernel version number. NIOS2 version.
+ 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
@@ -16,6 +17,6 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <sys/ipc.h> /* For __key_t */
+#include_next <kernel-features.h>
-#define __IPC_64 0x0
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
@@ -16,27 +16,7 @@
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 0x100
-
-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 SEMCTL_ARG_ADDRESS(__arg) &__arg.array
-
-#define MSGRCV_ARGS(__msgp, __msgtyp) \
- ((long int []){ (long int) __msgp, __msgtyp })
-
-#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \
- (__nsops), 0, (__sops), (__timeout)
-
-#include <ipc_ops.h>
+#define __OLD_IPC_ID_TYPE unsigned int
+#define __OLD_IPC_MODE_TYPE unsigned int
+#define __OLD_IPC_SEQ_TYPE unsigned short int
+#include <sysdeps/unix/sysv/linux/ipc_priv.h>
@@ -46,6 +46,7 @@
/* powerpc only supports ipc syscall. */
#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS 1
deleted file mode 100644
@@ -1,21 +0,0 @@
-/* Old SysV permission definition for Linux. RISC-V version.
- Copyright (C) 2018-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/>. */
-
-#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x0
@@ -50,6 +50,7 @@
#ifndef __s390x__
# define __ASSUME_SYSVIPC_BROKEN_MODE_T
#endif
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
#undef __ASSUME_CLONE_DEFAULT
#define __ASSUME_CLONE_BACKWARDS2
@@ -48,6 +48,7 @@
#if __BYTE_ORDER == __BIG_ENDIAN
# define __ASSUME_SYSVIPC_BROKEN_MODE_T
#endif
+#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64
/* Support for several syscalls was added in 4.8. */
#if __LINUX_KERNEL_VERSION < 0x040800
@@ -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
@@ -16,26 +16,18 @@
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
+#define __OLD_IPC_SEQ_TYPE unsigned short 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) \
deleted file mode 100644
@@ -1,32 +0,0 @@
-/* Old SysV permission definition for Linux. x86_64 version.
- Copyright (C) 2016-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/>. */
-
-#include <sys/ipc.h> /* For __key_t */
-
-#define __IPC_64 0x0
-
-struct __old_ipc_perm
-{
- __key_t __key; /* Key. */
- unsigned short uid; /* Owner's user ID. */
- unsigned short gid; /* Owner's group ID. */
- unsigned short cuid; /* Creator's user ID. */
- unsigned short cgid; /* Creator's group ID. */
- unsigned short mode; /* Read/write permission. */
- unsigned short int __seq; /* Sequence number. */
-};