From patchwork Mon May 20 17:53:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 164664 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp580698ili; Mon, 20 May 2019 10:54:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuSwiyFsdY8w3x3jHJdFQo/Q4d+OGuRqTopEXslD6FwPatRZyzrTHeFxO04/R8AZU315vz X-Received: by 2002:aa7:9e9a:: with SMTP id p26mr49649248pfq.176.1558374849157; Mon, 20 May 2019 10:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558374849; cv=none; d=google.com; s=arc-20160816; b=C/HmfwiT5csDhTt8hXiFVNPUyoA7vkEF43a+zeIBkLDwN1fG4Ud2pdlWMrcuLXB6yV WDnMoOga7DcFHcD8Xgewx679blVGRxsyhthDRDOy9FsNYJjyR2esb2sEQI/pzhOXP2WP CtML2Ek7nWTBv1Nf7A3PEKEGYJETKmVW5za7VEWHt9A2bjig50oVuPjdiVdvHCVilq3W 2zDw5P/zAZGQ0VPWDp+X5aKKh9Y6CnzhhpCzo1QRiUfly8bhv5XZC64H1ew4JYprw7B0 JZWeH7mEG/PTSZ519NCkM5hRmGmSwLFjrGSB3OwGooY3BUCbwao/i0ysUE0BVE/NxPze cACA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=mz4ChtJyqBSKIHLYOH1jxGpRASowM2Af7scu8H6Nr3Y=; b=i/yituwP/tfSix6NQ90iy859FtB+QquRPXIRglSw9k7gLq9DNMKlEhT33hTd+ovWw/ aAdmhIyslobLIG0wSY/qJgk+518Q5GEri4SGGOW9Rc8O7wdhBdv16fizlTqP1dxozdNn jwYxPBrU/kAJhIE4CcKBMITpzyYrT0DugJ+LNQROhEoqBCt6kQ2nDS+kQ48n/I2kAKIy 6aXSA3Hpkuf9jei9igw/n0Hq3+qDjPT1fB0BYL5FQsLORS9Pi5avxnpb4jnUkxettYw/ k2Y2JG0j08GMDpnqUSOj4MrYsCyHMkd68zlfg+bQXAsau6sKqgiUcvZNheK5URXsCosu KvmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=btBOFJZn; dkim=pass header.i=@linaro.org header.s=google header.b=DgOQo3Hp; spf=pass (google.com: domain of libc-alpha-return-102121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102121-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u6si12648614pgp.286.2019.05.20.10.54.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 10:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=btBOFJZn; dkim=pass header.i=@linaro.org header.s=google header.b=DgOQo3Hp; spf=pass (google.com: domain of libc-alpha-return-102121-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102121-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=KsAZD1nEwHd8BpDlqq9dXNC6tLSDaijLy+v9aJp50hwktPqT7Ccvm dDWAU2k6/ZkSLAaBp6PC/64ZLMOFDMyYfY61hBx0DgKXENYwnn1rEjtOkx3ATwiL r+Eq9i1dP5H2OcVyyYgfF1EZyDlwxn9aCdVc/p0shGVDYpoDZbFQPg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=hTqjGn/3TfhUApNzyfA7XFAx9/k=; b=btBOFJZnr1madrpAsEUfm5lWX1PO 3+p2zgflCjLAzf6O+QzjPiCUAnXNXsUYNZBk7s5c7c1bbVleY1JAfMwP3FFub94L VaDIi3x0pjN4X0HBZGy68B2pj4WKKLZqpXJI04a0/J6OKXf1URasvXdszlEQdtqs oRWsWnLphod+t4Y= Received: (qmail 35238 invoked by alias); 20 May 2019 17:53:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 35180 invoked by uid 89); 20 May 2019 17:53:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=2018-2019, 20182019, availability, correspondent X-HELO: mail-vs1-f65.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=mz4ChtJyqBSKIHLYOH1jxGpRASowM2Af7scu8H6Nr3Y=; b=DgOQo3Hpgmq9TbOQeaTWtxH2hV50zNOU46boZE4SlpRdDfkdCddaRBVDcYlcGehc3L 3T2HZAul1lndw+K2e2PgBUDnpbcUYmUSR/NzgQKR/Jtjx/Hq8n+yRbLhX+CituSfWndS uInfvJo+7EaGXBEb8Uw2XeRlpmYVmUbWVspOoWb+mz4gPYa0dAYNLDoXErWqKsbXJ3tR mU0kDHWAbJUca7J4qheyMylU6ggqwlIZZsKewqVvHM+MQpSheOxDbnHSitC0PEACiC/k Rwwc8X5qJWYcUoxEkiN/WyHLzLnElkj/m93fdg+crGwyd/b1xQjL4Q23Qkg+MF0jSLU3 kU5Q== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 1/2] ipc: Refactor sysvipc internal definitions Date: Mon, 20 May 2019 14:53:40 -0300 Message-Id: <20190520175341.17310-1-adhemerval.zanella@linaro.org> Changes from previous version: - Added __ASSUME_SYSVIPC_DEFAULT_IPC_64 instead of redefine __IPC_64 on kernel-features.h. The new assume macro is used to setup the __IPC_64 value on ipc-priv.h. - Annexed the 'ipc: Refactor sysvipc compat type' to make it possible share the generic ipc_priv.h definions for all architectures. -- 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 in wire-up or ipc 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 would not require add a ipc_priv.h to override the __IPC_64 value). 2. It removes some duplicated definition from sysvipc compat code at ipc_priv.h. The idea is also to make it simpler to enable the new wireup sysvipc on Linux v5.1. There is no semantic change expected on any port. Checked with a build against all affected ABIs. * sysdeps/unix/sysv/linux/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Use the new defines. * sysdeps/unix/sysv/linux/alpha/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Use the new defines. * sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Use the new defines. * sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Use the new defines. * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Define. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Undefine. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h [!__arch64__] (__ASSUME_SYSVIPC_DEFAULT_IPC_64): Likewise. * sysdeps/unix/sysv/linux/nios2/kernel-features.h: New file. * sysdeps/unix/sysv/linux/hppa/ipc_priv.h: Remove file. * sysdeps/unix/sysv/linux/ia64/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/nios2/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/csky/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/riscv/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/ipc_priv.h: Likewise. --- sysdeps/unix/sysv/linux/alpha/ipc_priv.h | 18 +++-------- .../unix/sysv/linux/alpha/kernel-features.h | 3 ++ sysdeps/unix/sysv/linux/arm/kernel-features.h | 2 ++ sysdeps/unix/sysv/linux/hppa/ipc_priv.h | 21 ------------ .../unix/sysv/linux/i386/kernel-features.h | 1 + sysdeps/unix/sysv/linux/ia64/ipc_priv.h | 21 ------------ sysdeps/unix/sysv/linux/ipc_priv.h | 31 +++++++++++++----- sysdeps/unix/sysv/linux/kernel-features.h | 3 ++ .../unix/sysv/linux/m68k/kernel-features.h | 1 + .../sysv/linux/microblaze/kernel-features.h | 2 ++ .../unix/sysv/linux/mips/kernel-features.h | 2 ++ .../unix/sysv/linux/mips/mips64/ipc_priv.h | 18 +++-------- sysdeps/unix/sysv/linux/nios2/ipc_priv.h | 21 ------------ .../ipc_priv.h => nios2/kernel-features.h} | 11 ++++--- sysdeps/unix/sysv/linux/powerpc/ipc_priv.h | 25 +++------------ .../unix/sysv/linux/powerpc/kernel-features.h | 1 + sysdeps/unix/sysv/linux/riscv/ipc_priv.h | 21 ------------ .../unix/sysv/linux/s390/kernel-features.h | 1 + sysdeps/unix/sysv/linux/sh/kernel-features.h | 1 + .../unix/sysv/linux/sparc/kernel-features.h | 3 ++ .../unix/sysv/linux/sparc/sparc64/ipc_priv.h | 20 ++++-------- sysdeps/unix/sysv/linux/x86_64/ipc_priv.h | 32 ------------------- 22 files changed, 67 insertions(+), 192 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/hppa/ipc_priv.h delete mode 100644 sysdeps/unix/sysv/linux/ia64/ipc_priv.h delete mode 100644 sysdeps/unix/sysv/linux/nios2/ipc_priv.h rename sysdeps/unix/sysv/linux/{csky/ipc_priv.h => nios2/kernel-features.h} (69%) delete mode 100644 sysdeps/unix/sysv/linux/riscv/ipc_priv.h delete mode 100644 sysdeps/unix/sysv/linux/x86_64/ipc_priv.h -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h index fc5e713f42..fa79bddcf3 100644 --- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h @@ -16,17 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* 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 diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 4a5d029c1d..f3aab5bcee 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -53,4 +53,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 */ diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h index 2d2d355844..75ac97a82f 100644 --- a/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -50,3 +50,5 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 diff --git a/sysdeps/unix/sysv/linux/hppa/ipc_priv.h b/sysdeps/unix/sysv/linux/hppa/ipc_priv.h deleted file mode 100644 index 5e170a9a2b..0000000000 --- a/sysdeps/unix/sysv/linux/hppa/ipc_priv.h +++ /dev/null @@ -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 - . */ - -#include /* For __key_t */ - -#define __IPC_64 0x0 diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 3ac725b5a2..411eb2fca4 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -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 diff --git a/sysdeps/unix/sysv/linux/ia64/ipc_priv.h b/sysdeps/unix/sysv/linux/ia64/ipc_priv.h deleted file mode 100644 index 6b2438cd03..0000000000 --- a/sysdeps/unix/sysv/linux/ia64/ipc_priv.h +++ /dev/null @@ -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 - . */ - -#include /* For __key_t */ - -#define __IPC_64 0x0 diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 1d1bd19541..d387b44c8f 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -17,18 +17,33 @@ . */ #include /* For __key_t */ - -#define __IPC_64 0x100 +#include + +#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 diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index bc5c959f58..fa99a11c2d 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -80,6 +80,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 /* Support for p{read,write}v2 was added in 4.6. However Linux default implementation does not assume the __ASSUME_* and instead use a fallback diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 1976724362..46418977c8 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -52,3 +52,4 @@ /* m68k only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index 8df19400af..bed0c4a4e5 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -72,3 +72,5 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS3 + +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index c341c3fa10..b9fa89c81d 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -50,3 +50,5 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h index bb31656069..682ec35662 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h @@ -16,17 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include - -#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 diff --git a/sysdeps/unix/sysv/linux/nios2/ipc_priv.h b/sysdeps/unix/sysv/linux/nios2/ipc_priv.h deleted file mode 100644 index d6e6be797a..0000000000 --- a/sysdeps/unix/sysv/linux/nios2/ipc_priv.h +++ /dev/null @@ -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 - . */ - -#include /* For __key_t */ - -#define __IPC_64 0x0 diff --git a/sysdeps/unix/sysv/linux/csky/ipc_priv.h b/sysdeps/unix/sysv/linux/nios2/kernel-features.h similarity index 69% rename from sysdeps/unix/sysv/linux/csky/ipc_priv.h rename to sysdeps/unix/sysv/linux/nios2/kernel-features.h index e1beadb2a0..7f4023831e 100644 --- a/sysdeps/unix/sysv/linux/csky/ipc_priv.h +++ b/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 @@ -13,9 +14,9 @@ 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 + License along with the GNU C Library. If not, see . */ -#include /* For __key_t */ +#include_next -#define __IPC_64 0x0 +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 diff --git a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h index 3450933f56..f641ed9a32 100644 --- a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h @@ -16,24 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* 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 }) - -#include +#define __OLD_IPC_ID_TYPE unsigned int +#define __OLD_IPC_MODE_TYPE unsigned int +#define __OLD_IPC_SEQ_TYPE unsigned short int +#include diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 413a185db3..e787182396 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.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 diff --git a/sysdeps/unix/sysv/linux/riscv/ipc_priv.h b/sysdeps/unix/sysv/linux/riscv/ipc_priv.h deleted file mode 100644 index ea957a56be..0000000000 --- a/sysdeps/unix/sysv/linux/riscv/ipc_priv.h +++ /dev/null @@ -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 - . */ - -#include /* For __key_t */ - -#define __IPC_64 0x0 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 8fdf38c454..57077ea4cc 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -47,6 +47,7 @@ /* s390 only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS2 diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index b11a5cb544..cf68256abe 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -43,6 +43,7 @@ /* sh only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __ASSUME_SYSVIPC_DEFAULT_IPC_64 /* Support for several syscalls was added in 4.8. */ #if __LINUX_KERNEL_VERSION < 0x040800 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index f441bd811d..82c8236c23 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 8936aed022..3d813fe9e6 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h @@ -16,26 +16,18 @@ License along with the GNU C Library; if not, see . */ -#include /* 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 /* 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 #include diff --git a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h deleted file mode 100644 index 1ac288aa65..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h +++ /dev/null @@ -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 - . */ - -#include /* 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. */ -};