From patchwork Thu May 16 15:12:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 1100622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102030-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="A//GkVPY"; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Lh0Wpi4n"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 454Zgh2MVfz9s7h for ; Fri, 17 May 2019 01:13:36 +1000 (AEST) 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:in-reply-to :references; q=dns; s=default; b=iM7a+XITt6I7wQwtxnWn0fzH1sCe47d t3XdiXPL2gGcO13VMNsIjnhrcpB+EtzP3lJCGLCXXNUd+a4hhoGgj0ApORQRrI7M 7DCXco/ld2252UZKmGpgi2CykMANbEZNQTQVEpY5gRwkkGvrgDj04LaiBfKZ6/J7 DfdppbzZFc5I= 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:in-reply-to :references; s=default; bh=HSMFo3IW5LNzvJkVY2YAcc/YTB8=; b=A//Gk VPYGmGy/RPuVetVPcITfYa4hw409f6kdAvBu3wlhdr8UQjHZQgNE+Xaufd33cf+M TWMtWMfkwVuFTZb+jdJ8IT8JTMLCeVv1skCBVKkdGtxuppZBbMIzLF6p5RlcBTZO 63eKw4DDwjn0M4bsPmAdKtcvMmm9WXNNt5Crxg= Received: (qmail 112221 invoked by alias); 16 May 2019 15:13:06 -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 112163 invoked by uid 89); 16 May 2019 15:13:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.7 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=gid X-HELO: mail-vs1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=ra53v1IX9G6cb5PfZPPz+Kta6kk4lUC9yrm2VtC+PSI=; b=Lh0Wpi4nfgZ899POyH0nip3YElcfrW3UEssaLT3arz1CKSYlQwlvJYEYkAz8xsrvbW NCY1pTB6h8/b6BwTleapInoaY7Z7eWAwm8SQG8ed2G2yq5pyMwev6lWBjw3Sr/4cE2Pf Ok0oW+xW8yCEWa8YjpEidmQ2L4Djg7cW71ATfNflgwEphGSHh3BAH4ksmnQaa/aCF1NE XTxkYQUBV0wMSs6+AfdLcAgzmM9gaZ/IPr0yTEqU5Y8rH9c4TvK7tSIxspw3vCXOnMqL DPpZoUKq7/qGCg7QyoQui5kdhDej3LzGaFnxgLAGND7AgGh6AN8pKp1KxrAcmysaeWW4 gEhQ== From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 4/5] ipc: Refactor sysvipc compat type Date: Thu, 16 May 2019 12:12:48 -0300 Message-Id: <20190516151249.19029-4-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> This patch removes some duplicated definition from sysvipc compat code. The idea is to make it simple to enable the new wireup sysvipc on Linux v5.1 for some 32 bits ABIs. 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): Remove definition. * 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): Remove definition. * sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm, SEMCTL_ARG_ADDRESS, MSGRCV_ARGS): Remove definitions. * sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h (__OLD_IPC_ID_TYPE, __OLD_IPC_MODE_TYPE, __OLD_IPC_SEQ_TYPE): Define. (__old_ipc_perm): Remove definition. * sysdeps/unix/sysv/linux/x86_64/ipc_priv.h: Remove file. --- sysdeps/unix/sysv/linux/alpha/ipc_priv.h | 16 +++------- sysdeps/unix/sysv/linux/ipc_priv.h | 27 +++++++++++++---- .../unix/sysv/linux/mips/mips64/ipc_priv.h | 16 +++------- sysdeps/unix/sysv/linux/powerpc/ipc_priv.h | 23 +++----------- .../unix/sysv/linux/sparc/sparc64/ipc_priv.h | 18 ++++------- sysdeps/unix/sysv/linux/x86_64/ipc_priv.h | 30 ------------------- 6 files changed, 39 insertions(+), 91 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/ipc_priv.h diff --git a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h index 8b91e2f9fa..fa79bddcf3 100644 --- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h @@ -16,15 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -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/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 49018c1b28..1f9583d42a 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -16,17 +16,30 @@ License along with the GNU C Library; if not, see . */ +#ifndef _IPC_PRIV_H +#define _IPC_PRIV_H + #include /* For __key_t */ +#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 @@ -38,3 +51,5 @@ struct __old_ipc_perm (__nsops), 0, (__sops), (__timeout) #include + +#endif /* _IPC_PRIV_H */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h index ab5db79e25..682ec35662 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h @@ -16,15 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include - -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/powerpc/ipc_priv.h b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h index 1c480ac0dd..f641ed9a32 100644 --- a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h @@ -16,22 +16,7 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -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/sparc/sparc64/ipc_priv.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h index 685c25439b..3d813fe9e6 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h @@ -16,24 +16,18 @@ License along with the GNU C Library; if not, see . */ -#include /* For __key_t */ - -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 ab44949e6d..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h +++ /dev/null @@ -1,30 +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 */ - -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. */ -};