From patchwork Thu May 16 15:12:45 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: 164331 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp967747ili; Thu, 16 May 2019 08:13:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1Y0M8e/xOvV+m5Gc7jNL9DNMsQKUjdjdq5Hs0890doIfPP/OzLVhc0CtnPc4N/woUvroY X-Received: by 2002:a17:902:b90c:: with SMTP id bf12mr5022962plb.136.1558019588590; Thu, 16 May 2019 08:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019588; cv=none; d=google.com; s=arc-20160816; b=F+nc2RWcbkOQWNUuhi75TIOSeHVzhaPQp6UI8A04MnaQTF6jyS9d4T64Ye7x22i1xU SMYrU86mfcXY6ukbPrm2GHiK9z8Ne02RTEIjsNuKM0UwBZErPsLXKr2RTpTbi2MP7heL Bn5yWvnsvIlV5yG+V7ZI+pnURyXrvE1jhVMUnErJvB+BQMdqRyMcipcDXS2QNttxNlPH PliPQ/2mZFUx/Y/Kj+rhGNlAdfn2kykShlUQHy7kJ9MDXry7QLcd+fCSutov49gSuTdI EPEOJoyY0LWFBHQt2Sc+WMIGVWQ8zaj7rUJMT7WiXiq3/kSJyxhs1h5QPAgkMjKcrR9H qIcA== 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=PEYhLaCoR4AJ/gdYrySvugQLRhuHBXNEWddmsaJtYAY=; b=FUxsrg5WiDoCx56gAzQfjQ5qS7HUCGAvinaS0wE9gVda97Ohg8c6fgI4l3DtQ0pwaO AjhZfZYRh0pXnPk39DNfD1dSfmqwh6ngAHeoS7vU+cNOryjjUqkFFPI0/SiCj38SR3XZ hooYbeTfA/4eyuJLJIeZhkP55ljMo7VyiqdBa6ykubdzuHtrdUs4TYwsgNjccD/NwuVo wruLG4onmRRH5ORvK0o9FYPINPJMi7qB933gOUoa3QO5AEywxiqqTAJpDtlQF0f27kzb 3GA4X3db5iYs14QRoduzPY2ZBUWfwRbAxEOnGHoshNwUqRCwSZc281v8vFV+b4TDu0Gw reMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=jZdxB6Qn; dkim=pass header.i=@linaro.org header.s=google header.b="R90Rg/aR"; spf=pass (google.com: domain of libc-alpha-return-102027-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102027-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 x10si4940886plo.422.2019.05.16.08.13.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102027-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=jZdxB6Qn; dkim=pass header.i=@linaro.org header.s=google header.b="R90Rg/aR"; spf=pass (google.com: domain of libc-alpha-return-102027-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102027-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=g3NFvrHyJ/groBu6HrXWb3Aq03/jAmAnrM9RkyLtKYRlxOfiIDj1d gno3MMgu7FP1ax/ihjrWuyAwPubJ+gUcUrRyDbsfjBciXg1FbFcQXc/ujVOdB0Jn 081EDBg+A1R8wLstk5PEWaEtoKtdr5H2Nuth5zGn1GFxzhFXpj+tnU= 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=d8gb5JKjDuHhKDCpprfKhsNtWQQ=; b=jZdxB6QnP4BBvRMChIfUNboWQQiK TJOHA1dHFi5gpfPpFlNljD09KPQytFPtSh6I4JdueQS4Lhfop4JurlCTmyC5hCZc 2LedA6Asu6ZCWrQpcaM2agXgSC73JWzrHwG6/dxbOp5ejcjIpRkLljKqSGDo//v9 G7bdXcSwUOafB2E= Received: (qmail 111177 invoked by alias); 16 May 2019 15:12:59 -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 111168 invoked by uid 89); 16 May 2019 15:12:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:979 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; bh=PEYhLaCoR4AJ/gdYrySvugQLRhuHBXNEWddmsaJtYAY=; b=R90Rg/aR5biNtL8GSjg5g/jlqZ3+A+zPv56SWlwb18mSDecny8f56MesknwhBW2sqI l2g7gz6Vw3bOuB/weqcdeqkOIiwn19wAxiCWWgdiYJyCHb69xPMc7CxLN6zdRIW9VnI8 xx9js6rTTKlFCSLzs7Luaaj/EoQp6TcJNUI+iG9dJZ4Qh2O5uDjQP280/jCL4gVHYnkQ bIRXqQ0jh7Vs+WTcFMtoo56mUCkI8qURNmAX+/JIA2qN05UflfvFyi0rxkb+6s/i2JNZ g3nDYISBpe+lgRoORHDV8XIURGVPqXcdEN3v09iADEqHq0G4HfC/FQTuEz4aE6ky73+m 4R/A== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 1/5] sysvipc: Fix compat msgctl Date: Thu, 16 May 2019 12:12:45 -0300 Message-Id: <20190516151249.19029-1-adhemerval.zanella@linaro.org> The __IPC64 flags is meant to be used to enable the new sysv struct format when the architectures supports it (ARCH_WANT_IPC_PARSE_VERSION config flag on Linux kernel). This currently issue only affects alpha. * sysdeps/unix/sysv/linux/msgctl.c (__old_msgctl): Remove __IPC_64 usage. --- sysdeps/unix/sysv/linux/msgctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c index e4f78adda1..2d49567686 100644 --- a/sysdeps/unix/sysv/linux/msgctl.c +++ b/sysdeps/unix/sysv/linux/msgctl.c @@ -62,7 +62,7 @@ attribute_compat_text_section __old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf) { #ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS - return INLINE_SYSCALL_CALL (msgctl, msqid, cmd | __IPC_64, buf); + return INLINE_SYSCALL_CALL (msgctl, msqid, cmd, buf); #else return INLINE_SYSCALL_CALL (ipc, IPCOP_msgctl, msqid, cmd, 0, buf); #endif From patchwork Thu May 16 15:12:46 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: 164333 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp968196ili; Thu, 16 May 2019 08:13:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1KVFicvLOSWGC2JkMNs+B2YZ1QsNrllFiTEA4hCoeVv/407e1HGCC1IAwPtNIb7I6W8Lq X-Received: by 2002:a63:2b03:: with SMTP id r3mr49448739pgr.105.1558019607666; Thu, 16 May 2019 08:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019607; cv=none; d=google.com; s=arc-20160816; b=TIWWiU1UtxfPFs2ueOAJ47mVVLA0H9Umm7mq1ChVlxSScTwjE7DwouUhCPJyNrHy3o 504Cg+OofqreWYyUrUJ2chBTsJ2vxAmfyj5ZrePjPMPpAaLqvqBrJM1TNvj9a4KhltP+ mG9NdS4AVwcPaRZiOEmunpuowJgp3eSY1pHNAa3xJgoC+ldVMYi1uB54Z1zoysoU87/S L8Ivi75677fFR7t/rZqBmDt7r2Kob1XnY6yyBHDBWo4mHpV3N9Qfy17LLiuRxjx3dif0 QMVwp8gEVOk5dn/9VfwkfBMSU0+TDLGL8Iv/6SLjLojDwi86h5X/U7wWVqFgf4LEELr4 hGVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to: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=Z0NY/PT9dod+1A+d1qfQoPwCf8KW58DKi3jQGSMWKSw=; b=FcFdu/A7d5c+QhxdeTZFyWMdG8ipABOtqqnhJ5p3X5C6LkVdf9buGaGJcaeW9FFKL+ ozXvtPxADB/CCKUCtsRY7NRQfRd0ebnTGUr1Wq7qbPsm1g0Ja9sDo5K/lFWCtt0IC9bj RGzYwORjKij7uExkY5iBm+Vx445EDLS+6csYgJPILgpUULI3EjdvbO6Y6J0NWPDYJfn5 pVZlc6IrNp1Oc7TNGOH8bxq4vHA/Qs1BJTWCaR6Q6zrcl4WDdGWhQs9k64rvNCCHWvup rV/hgryf9fnZWSYPKePihAZgTzurlBfq7YRV30NrjgkrXNhj1cxne4rFrzeKalCs7oeW Yt/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=EihES3Cu; dkim=pass header.i=@linaro.org header.s=google header.b=SLOvT0Gg; spf=pass (google.com: domain of libc-alpha-return-102029-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102029-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 l4si5115784pgp.280.2019.05.16.08.13.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:27 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102029-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=EihES3Cu; dkim=pass header.i=@linaro.org header.s=google header.b=SLOvT0Gg; spf=pass (google.com: domain of libc-alpha-return-102029-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102029-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:in-reply-to :references; q=dns; s=default; b=KHzYJ0TDBZnfEWekGUs8x7EdIAtiEvW xaue6A7NFB3UopsCRTUPUuaALuCLJHBO9/7os9Z9tFHcLJNd4a4TqvrjK+sQXjk1 NkDuZthLxxrBMRN06a5y6aio1RO4X/8iKiBoTdkcXP4Mu25CGatyEFMS9sIobqDn p4rVK9XWGLtc= 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=oGfFdKhYhk3Xnhohmb69lc7V87Q=; b=EihES 3Cuo8wtpNRggqfzSc0eV4yzmFURcCDu5q/jD7nBF2G6/KimspQ67X1A7mLWMDCZr LFTDfeXOguqDJpLNjgKthaGueMKwyTbYnbL5LaGgyiDa5sRn7dFIV59rcFGcrPRH CwpR4G+CUmVfIhXX2+Q0l8MlDftclf1xJVWmmU= Received: (qmail 111800 invoked by alias); 16 May 2019 15:13:04 -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 111720 invoked by uid 89); 16 May 2019 15:13:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.6 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=correspondent, Direct, aligning, 2018-2019 X-HELO: mail-ua1-f68.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=Z0NY/PT9dod+1A+d1qfQoPwCf8KW58DKi3jQGSMWKSw=; b=SLOvT0GgaHEbKOiE4lhlsTrdg78mCpMxFTyoAMpGJlJP8Q2wA3YLquXTuqC3a2SeUn 1R16bBKDwvbcPJsxpLH2hQJs+rjNlrnVMhj17M784GidXpj2J2iBHcOCWQT6QDEYCN+0 gpJrSVzYuBaitJZq2ortZxRZP3booCFE2fSyHbnKRBR4j1EsvyQUJDBC8Ge3FTWjHul6 pjqovJbUCxsj8/8XzZ1VfwGVwIXD5nBK4J1/4y1Si/fRwOWidz5yvOsqj9+5yMpIDyGF sBm6dNn0Z111NpqsQYnDl7lXBPSlM6oqEVJKU9/8MJcVf/iKdV76sbj0egB4Ypksncip xs4Q== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/5] sysvipc: Move __IPC_64 to kernel-features.h Date: Thu, 16 May 2019 12:12:46 -0300 Message-Id: <20190516151249.19029-2-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> This patch moves the __IPC_64 definition from ipc_priv.h header to kernel-features.h. It also changes the expected value for newer ports from 0x100 to 0x0, aligning with Linux UAPI. The idea is to simplify the Linux 5.1 wire-up of sysvipc syscalls for some 32-bit ABI, which expected __IPC_64 to be 0x0 (thus tying its value to minimum supported kernel version). There is no semantic change expected on any port. Checked with a build against all affected ABIs. * sysdeps/unix/sysv/linux/alpha/ipc_priv.h (__IPC_64): Remove definition. * sysdeps/unix/sysv/linux/ipc_priv.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/powerpc/ipc_priv.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/x86_64/ipc_priv.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/csky/ipc_priv.h: Remove file. * sysdeps/unix/sysv/linux/hppa/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/ia64/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/nios2/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/riscv/ipc_priv.h: Likewise. * sysdeps/unix/sysv/linux/alpha/kernel-features.h (__IPC_64): Define. * sysdeps/unix/sysv/linux/arm/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/microblaze/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__IPC_64): Likewise. * sysdeep/unix/sysv/linux/mips/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/nios2/kernel-features.h: New file. * sysdeps/unix/sysv/linux/sparc/kernel-features.h [!__arch64__] (__IPC_64): Define. --- sysdeps/unix/sysv/linux/alpha/ipc_priv.h | 2 -- .../unix/sysv/linux/alpha/kernel-features.h | 4 ++++ sysdeps/unix/sysv/linux/arm/kernel-features.h | 8 +++++++ sysdeps/unix/sysv/linux/csky/ipc_priv.h | 21 ------------------- sysdeps/unix/sysv/linux/hppa/ipc_priv.h | 21 ------------------- .../unix/sysv/linux/i386/kernel-features.h | 7 +++++++ sysdeps/unix/sysv/linux/ia64/ipc_priv.h | 21 ------------------- sysdeps/unix/sysv/linux/ipc_priv.h | 2 -- sysdeps/unix/sysv/linux/kernel-features.h | 1 + .../unix/sysv/linux/m68k/kernel-features.h | 8 +++++++ .../sysv/linux/microblaze/kernel-features.h | 7 +++++++ .../unix/sysv/linux/mips/kernel-features.h | 8 +++++++ .../unix/sysv/linux/mips/mips64/ipc_priv.h | 2 -- sysdeps/unix/sysv/linux/nios2/ipc_priv.h | 21 ------------------- .../ipc_priv.h => nios2/kernel-features.h} | 17 ++++++++++----- sysdeps/unix/sysv/linux/powerpc/ipc_priv.h | 2 -- .../unix/sysv/linux/powerpc/kernel-features.h | 8 +++++++ sysdeps/unix/sysv/linux/riscv/ipc_priv.h | 21 ------------------- .../unix/sysv/linux/s390/kernel-features.h | 8 +++++++ sysdeps/unix/sysv/linux/sh/kernel-features.h | 3 +++ .../unix/sysv/linux/sparc/kernel-features.h | 9 ++++++++ .../unix/sysv/linux/sparc/sparc64/ipc_priv.h | 2 -- sysdeps/unix/sysv/linux/x86_64/ipc_priv.h | 2 -- 23 files changed, 83 insertions(+), 122 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/csky/ipc_priv.h 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/{aarch64/ipc_priv.h => nios2/kernel-features.h} (62%) delete mode 100644 sysdeps/unix/sysv/linux/riscv/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..8b91e2f9fa 100644 --- a/sysdeps/unix/sysv/linux/alpha/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/alpha/ipc_priv.h @@ -18,8 +18,6 @@ #include /* For __key_t */ -#define __IPC_64 0x100 - struct __old_ipc_perm { __key_t __key; /* Key. */ diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index f3298b234e..00f7d44df0 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -22,6 +22,10 @@ #include_next +/* Alpha support old sysvipc even being a 64-bit architecture. */ +#undef __IPC_64 +#define __IPC_64 0x100 + /* There never has been support for fstat64. */ #undef __ASSUME_STATFS64 #define __ASSUME_STATFS64 0 diff --git a/sysdeps/unix/sysv/linux/arm/kernel-features.h b/sysdeps/unix/sysv/linux/arm/kernel-features.h index 2d2d355844..4f5c621f82 100644 --- a/sysdeps/unix/sysv/linux/arm/kernel-features.h +++ b/sysdeps/unix/sysv/linux/arm/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + #include_next /* The ARM kernel before 3.14.3 may or may not support @@ -50,3 +53,8 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#undef __IPC_64 +#define __IPC_64 0x100 + +#endif /* _KERNEL_FEATURE_H */ diff --git a/sysdeps/unix/sysv/linux/csky/ipc_priv.h b/sysdeps/unix/sysv/linux/csky/ipc_priv.h deleted file mode 100644 index e1beadb2a0..0000000000 --- a/sysdeps/unix/sysv/linux/csky/ipc_priv.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Old SysV permission definition for Linux. C-SKY 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/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..5a26328d97 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + /* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 @@ -45,6 +48,10 @@ /* i686 only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __IPC_64 +#define __IPC_64 0x100 #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#endif /* _KERNEL_FEATURES_H */ 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 7f517eb6fd..65adbb093e 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -18,8 +18,6 @@ #include /* For __key_t */ -#define __IPC_64 0x100 - struct __old_ipc_perm { __key_t __key; /* Key. */ diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index bc5c959f58..8fb6078de5 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -80,6 +80,7 @@ /* 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 +#define __IPC_64 0x0 /* 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..8e81bb98ef 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + /* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 @@ -52,3 +55,8 @@ /* m68k only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + +#undef __IPC_64 +#define __IPC_64 0x100 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index 8df19400af..84b813d6ab 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -15,6 +15,8 @@ License along with the GNU C Library. If not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 /* All supported kernel versions for MicroBlaze have these syscalls. */ #define __ASSUME_SOCKET_SYSCALL 1 @@ -72,3 +74,8 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS3 + +#undef __IPC_64 +#define __IPC_64 0x100 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index c341c3fa10..d90d87a5b0 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library. If not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + #include #include_next @@ -27,6 +30,9 @@ # undef __ASSUME_SET_ROBUST_LIST #endif +#undef __IPC_64 +#define __IPC_64 0x100 + /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ #if _MIPS_SIM == _ABIO32 @@ -50,3 +56,5 @@ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h index bb31656069..ab5db79e25 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/ipc_priv.h @@ -18,8 +18,6 @@ #include -#define __IPC_64 0x100 - struct __old_ipc_perm { __key_t __key; /* Key. */ 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/aarch64/ipc_priv.h b/sysdeps/unix/sysv/linux/nios2/kernel-features.h similarity index 62% rename from sysdeps/unix/sysv/linux/aarch64/ipc_priv.h rename to sysdeps/unix/sysv/linux/nios2/kernel-features.h index cf55907693..813177f7b7 100644 --- a/sysdeps/unix/sysv/linux/aarch64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/nios2/kernel-features.h @@ -1,5 +1,6 @@ -/* Old SysV permission definition for Linux. AArch64 version. - Copyright (C) 2016-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,15 @@ 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 */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 -#define __IPC_64 0x0 +#include_next + +#undef __IPC_64 +#define __IPC_64 0x100 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h index 3450933f56..1c480ac0dd 100644 --- a/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/powerpc/ipc_priv.h @@ -18,8 +18,6 @@ #include /* For __key_t */ -#define __IPC_64 0x100 - struct __old_ipc_perm { __key_t __key; /* Key. */ diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index 413a185db3..b0fd94b139 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + /* New syscalls added for PowerPC in 2.6.37. */ #define __ASSUME_SOCKET_SYSCALL 1 #define __ASSUME_BIND_SYSCALL 1 @@ -47,5 +50,10 @@ /* powerpc only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __IPC_64 +#define __IPC_64 0x100 + #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#endif /* _KERNEL_FEATURES_H */ 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..12338c0090 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + /* Direct socketcalls available with kernel 4.3. */ #if __LINUX_KERNEL_VERSION >= 0x040300 # define __ASSUME_SOCKET_SYSCALL 1 @@ -48,5 +51,10 @@ /* s390 only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __IPC_64 +#define __IPC_64 0x100 + #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS2 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 767df721b8..1f8e140232 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -44,6 +44,9 @@ /* sh only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#undef __IPC_64 +#define __IPC_64 0x100 + /* Support for several syscalls was added in 4.8. */ #if __LINUX_KERNEL_VERSION < 0x040800 # undef __ASSUME_RENAMEAT2 diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index f441bd811d..4cbe8399ac 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -17,6 +17,9 @@ License along with the GNU C Library; if not, see . */ +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + #include_next /* 32-bit SPARC kernels do not support @@ -60,6 +63,10 @@ /* sparc only supports ipc syscall. */ #undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +#ifndef __arch64__ +# undef __IPC_64 +# define __IPC_64 0x100 +#endif /* Support for the renameat2 syscall was added in 3.16. */ #if __LINUX_KERNEL_VERSION < 0x031000 @@ -79,3 +86,5 @@ (INLINE_CLONE_SYSCALL). */ #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 + +#endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h index 8936aed022..685c25439b 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/ipc_priv.h @@ -18,8 +18,6 @@ #include /* For __key_t */ -#define __IPC_64 0x0 - struct __old_ipc_perm { __key_t __key; /* Key. */ diff --git a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h index 1ac288aa65..ab44949e6d 100644 --- a/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/x86_64/ipc_priv.h @@ -18,8 +18,6 @@ #include /* For __key_t */ -#define __IPC_64 0x0 - struct __old_ipc_perm { __key_t __key; /* Key. */ From patchwork Thu May 16 15:12:47 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: 164332 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp967953ili; Thu, 16 May 2019 08:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWY7y1GjTV3MY0eSwV6yq/2rTgZqoIHQOGgOnv/6n3JaFojKZx04NgOyQ2wVtvbMn6Z7xX X-Received: by 2002:a62:7793:: with SMTP id s141mr54855057pfc.21.1558019597734; Thu, 16 May 2019 08:13:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019597; cv=none; d=google.com; s=arc-20160816; b=LsnpLG+LG9pykj1haK9p5vIImMUqKznZ49XNcRcjO44W5CI5oM7eRx8hH4wKnyebA0 A7guMD7r3eM6/rzXZOX51ASflaXhILxjDBzy3vh19T+nLz/BHURXcq5TZXF7k+EpFvMp G0nTsXbSClvlumCQ9+6Q1yPIqfBuj4zaWBjJbc9iGBbdjZbYo7rTHxnVFFJDxa55uN4T f78LwjOCFdjtgqoTp8D8v9hBFGjPCg7oKFn10NO88sRinJqxlP0Yzbv4fUlHhiK3BEGV ZKV5fzJb6Xy1RHk+Ypom/V6iDVbyw0wxJiOYH05NN29WSXrFRc0B0+YoKAv1FyHEBpHt yPPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to: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=9m69zKOsap7IrJP/QEjtJNICZJK20PB0qqL5SmbpddU=; b=IwWKtXaRJdnqol6SK5qZuXS6RSEwRfbQ15MP8JT4FDqQPuQN6am+aE6mTxKGgF66ZK jw2YPh3dec30yg3ae/VrGTFdm0yJ+k4ZPRmVsr25Po/c3jdi637LO7fhZOTGzpPLLpGl X9BbnzI1+dRrbSTQUQ51korVNcyAZVRuYsFa8jAlAfNdyX9bwGo1NFuxeM0Iyv/AMz8H WVHVUXrkkHIR3V0akwf9LsH9RgkuBqxsyWfCYRA/KVUSIzNY8ZDFHtY7iughQ0xZLUQN e+/LOxyPebhPFCTz+Vp+GfFEkae9XT/YFi101D7ChUz++RIk7wMw8nAVEHy+xi5KAhN2 ZaBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hn+QZ7G6; dkim=pass header.i=@linaro.org header.s=google header.b=Gt9EGicj; spf=pass (google.com: domain of libc-alpha-return-102028-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102028-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 p12si5048949pgc.310.2019.05.16.08.13.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:17 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102028-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=hn+QZ7G6; dkim=pass header.i=@linaro.org header.s=google header.b=Gt9EGicj; spf=pass (google.com: domain of libc-alpha-return-102028-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102028-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:in-reply-to :references; q=dns; s=default; b=aEAqrVO+QTub1kRpAdB55vA3g12hojf ulNLVc8bSNB/TYnNOimeRnEpmJxsbw7zSliBWnLH1utcKriw6UjJX2kerGJpzo20 YC/HvCPYLijOXgQoIAwLeVWKB5YhdeX92gCHlohRv4kq5nuTd+2MKWK8Iqmx+agA LOgf1CszEjTE= 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=y785AKnOU7X0rvnb3ITRf4OP2z8=; b=hn+QZ 7G6TTZ5E31/j5JaHnxlifbXftTrkh190ucPLr7EdWOy3cifaY8F0w8hH1pHRdGyI 0hMD6JAXVXgvzSs+f5QD5Lp12HbDDpy2znLcLCgZkevfaj/O6u06DjYyecwlE+Kg 4sEZ6QIcRRdxLp/itsMHIoJb1Up/Cg+NQTHT9I= Received: (qmail 111775 invoked by alias); 16 May 2019 15:13:04 -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 111714 invoked by uid 89); 16 May 2019 15:13:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=fifth, s390linuxgnu, s390-linux-gnu, 2003 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=9m69zKOsap7IrJP/QEjtJNICZJK20PB0qqL5SmbpddU=; b=Gt9EGicjSmAJVO6APx2qvfMgDFWs97k5S4Rk4UNHHq/j51EToNNHmg1dZpqK0LSQIg 4TP8ng5mUfWf9YhqaKb7uPWxIWLMr0PMRKiVE+FtqmhiqpaW0HZxxR2DhmcAK8U4Fm/W A6Qvdm75oEID80GfZ6Z/Ez5qnmXz51gZRzNZLDLiVzrpBuFaMB2XeB0Yl6o2X0ph6RcZ cG94TDSVh9UzPCWNoBwC7kDx1tUeI+z+iwsSfWt7nPS+N8aDkocFye/HvpcrCoVZRu5I VVpOL8kn6rLXhZ3tnK9skh7rSwpDdjZYCL9xHaH+P9W6P40toxebZYdskXOEZkVO4nUM 5uIA== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 3/5] sysvipc: Consolidate semtimedop s390 Date: Thu, 16 May 2019 12:12:47 -0300 Message-Id: <20190516151249.19029-3-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> This patch consolidates the s390-32 semtimedop implementation by defining a arch-specific SEMTIMEDOP_IPC_ARGS to rearrange the arguments expected by s390 Linux kABI. The idea is to avoid have multiples semtimedop implementation changes for Linux v5.1 change to enable wire-up sysvipc support. Checked with a s390-linux-gnu and checking that resulting semtimedop objects do not change. * sysdeps/unix/sysv/linux/ipc_priv.h (SEMTIMEDOP_IPC_ARGS): New define. * sysdpes/unix/sysv/linux/s390/s390-32/ipc_priv.h: New file. * sysdeps/unix/sysv/linux/s390/semtimedop.c: Remove file. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Use SEMTIMEDOP_IPC_ARGS for calls with __NR_ipc. --- sysdeps/unix/sysv/linux/ipc_priv.h | 3 ++ .../unix/sysv/linux/s390/s390-32/ipc_priv.h | 29 +++++++++++++++ sysdeps/unix/sysv/linux/s390/semtimedop.c | 36 ------------------- sysdeps/unix/sysv/linux/semtimedop.c | 4 +-- 4 files changed, 34 insertions(+), 38 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h delete mode 100644 sysdeps/unix/sysv/linux/s390/semtimedop.c -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/ipc_priv.h b/sysdeps/unix/sysv/linux/ipc_priv.h index 65adbb093e..49018c1b28 100644 --- a/sysdeps/unix/sysv/linux/ipc_priv.h +++ b/sysdeps/unix/sysv/linux/ipc_priv.h @@ -34,4 +34,7 @@ struct __old_ipc_perm #define MSGRCV_ARGS(__msgp, __msgtyp) \ ((long int []){ (long int) __msgp, __msgtyp }) +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), 0, (__sops), (__timeout) + #include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h b/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h new file mode 100644 index 0000000000..9d74e92289 --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/s390-32/ipc_priv.h @@ -0,0 +1,29 @@ +/* Arch-specific SysV IPC definitions for Linux. s390 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 + 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 + +/* The s390 sys_ipc variant has only five parameters instead of six + (as for default variant) and the only difference is the handling of + SEMTIMEDOP where on s390 the third parameter is used as a pointer + to a struct timespec where the generic variant uses fifth parameter. */ +#undef SEMTIMEDOP_IPC_ARGS +#define SEMTIMEDOP_IPC_ARGS(__nsops, __sops, __timeout) \ + (__nsops), (__timeout), (__sops) + +#include diff --git a/sysdeps/unix/sysv/linux/s390/semtimedop.c b/sysdeps/unix/sysv/linux/s390/semtimedop.c deleted file mode 100644 index 772ee432a9..0000000000 --- a/sysdeps/unix/sysv/linux/s390/semtimedop.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 2003-2019 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Martin Schwidefsky , 2003. - - 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 -#include -#include -#include - -/* Perform user-defined atomical operation of array of semaphores. */ - -int -semtimedop (int semid, struct sembuf *sops, size_t nsops, - const struct timespec *timeout) -{ - /* The s390 sys_ipc variant has only five parameters instead of six - (as for default variant) and the only difference is the handling of - SEMTIMEDOP where on s390 the third parameter is used as a pointer - to a struct timespec where the generic variant uses fifth parameter. */ - return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, timeout, - sops); -} diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c index 961c6d1f0b..1d746c4117 100644 --- a/sysdeps/unix/sysv/linux/semtimedop.c +++ b/sysdeps/unix/sysv/linux/semtimedop.c @@ -30,7 +30,7 @@ semtimedop (int semid, struct sembuf *sops, size_t nsops, #ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout); #else - return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, nsops, 0, sops, - timeout); + return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, + SEMTIMEDOP_IPC_ARGS (nsops, sops, timeout)); #endif } 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 Netto X-Patchwork-Id: 164334 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp968470ili; Thu, 16 May 2019 08:13:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7csVGgLoeUkouqH8W+MSkFKicS42zP0uPbxt5d+1EusSuWVKUxG/Tpmi4BD+Nh8ytSMLt X-Received: by 2002:a17:902:e9:: with SMTP id a96mr24462688pla.37.1558019619320; Thu, 16 May 2019 08:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019619; cv=none; d=google.com; s=arc-20160816; b=r7IEuMQ0xuc4bIF8oQ2LOhnqCcoYci5fRt8Q2OecHPZ9LSON33YIgXqQDQPER4bDyt 7+LWwdAp4xmW6WYoEPP2gQKTPAYCl2DZ8wuASTb4XLSGFh2+oUpHQbBB5t4fkpjBnSU6 Al247Y0M9OQz3Wz6Y1oAZ4/1FQ4KNSiP/rS4UBg+kyB8nrf3z2FEbk8qhmAo/VRDOrDl l72CCNVxT2zZFHrYVF5Uyx6syk3+cMgYZ0ZdXXFAFpRC0yd2ZvhHe23R+0oDWTcydISb L8o1gzYZ6G/9MQDbPNIlRuwqu9ysbZSzQO3J4WFVUbytYkxzLyCODusvGvTuiE22husJ bxrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to: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=ra53v1IX9G6cb5PfZPPz+Kta6kk4lUC9yrm2VtC+PSI=; b=Wreiud1gMwvjKc+luikKEgDK6OaN30AjFVo/W+oJAWRMEO6xayBwO925Bo+yQv9r9j LWIW9zkEh7sDh9T3ywFST+Yzyn+o8/vhsEK+StSFt9QbIkFbb2Bo9TEBVISveejXexAB ut9LXMiEpyI06mVv4Gtu7r4FvqK7XiBUCYA30MOPAuf6MFxcn6XmmX81XScjVb8iiNfj v97oT9Z3cx+IspVosL1kKsnBQsrIHqte5hwx5mqkvGoutUfxaq4NEN8U/DgZVEam56QG FOOOT49vShUJILdm5AIzErpXFSM7w2dhGNz5C7rebPKp1L7ckgjMO8ujK19XAzuJ1EQz JbTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MGyQyKB6; dkim=pass header.i=@linaro.org header.s=google header.b=Lh0Wpi4n; spf=pass (google.com: domain of libc-alpha-return-102030-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102030-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 x28si5667668pff.104.2019.05.16.08.13.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102030-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=MGyQyKB6; dkim=pass header.i=@linaro.org header.s=google header.b=Lh0Wpi4n; spf=pass (google.com: domain of libc-alpha-return-102030-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102030-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:in-reply-to :references; q=dns; s=default; b=q5/G/XaDFcvC8UR2j7wfiSDRypVzRnC p60lRsFSbyccACf6h6T2tHyV0L5l0buCmLcZFCrxYVBv9P2biRQkYdK7NoRZPH+g 8dXlnOBpf2BQo4m0sBaMz2Dv6sif394bSQ2FrfeqbSiCgQGsPNrQ5XuvHXhfVoNb pFyZJFHVrW+c= 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=MGyQy KB6h5nHKkkwfnp62qe7QagzIvqGVosPzAiaoL7NnuRYWAHKxcBOXvFVIubEKgnCG BsxQVSwi+l1zQtIxqGsm3ABzKlleyq5M1ABGsJAGn9lQ9O0B9G4x53vWVQudlH2w i2DKczaiF7GsCubHvkCbUI5jzW6CJy37wATvvs= 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== Return-Path: 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 -- 2.17.1 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. */ -}; From patchwork Thu May 16 15:12:49 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: 164336 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp968675ili; Thu, 16 May 2019 08:13:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRKY6nBIrv8gvhfFIlNjVoKyrX7DsfQlntWuTiLN/nGvMsBfkDlOSrmU+nqU0nGGLg1nQk X-Received: by 2002:a17:902:a510:: with SMTP id s16mr50680320plq.334.1558019628558; Thu, 16 May 2019 08:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558019628; cv=none; d=google.com; s=arc-20160816; b=BCFsvwq0fVYpJpEyKlwfScPNtSKiKc+FbM7gOWiPVFJT9icK1h5a78lVigXX8q7CbA m0V8NFWGaVT9qx7TgdDgWQ8sZT4YGRXI+W1sn1YC4i6IJv5B9IlGbUU5u2o2Kwcgrd+t UNHZsqTOmpBlUE9ZO9xO4E2k1DA7eJ802qm8XJ+I8waiv+w4Csw5eBTap4I7DVS+lzQG u8h1KfBisFEEuKaF9jxPRzHaibTWUDdq+5l0ThSxF231x6Scvdz17zD8zAWJht5milRl qqYuRhUu2yZQqhASxUjcbM2v+GsITj8fDd3wyTyYdhNVhDzKSxlUVjUmQ738UbJkuyUx N2rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to: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=bfa33/ZEuPBPvdlSrJzLcKQHFGevAMWx9pPJZqsAoFc=; b=sErVWmrsYeoZdB2L46FVGhYJ+kxkPsLw7lowWr5Sz1m9VJkVYhDIh/ygcGe/AaygNT mn2d33qxURd1KGMFGcSzoUZwcBFER1ID8cPUzp85XrCdb2JhOROHIHgAOlxtZs16zCLC 9td/Q+vcYdI8yFsmx7+fy81N/cSGp0eBAnOeS/b3Qv1dPYBOgyhQvujSDS1/Q57BwW2m +ttl3HJg/34E3JVxAjAYHtONx525mPJK1qt39HCtyQg815hicrMcg+t19bzYFANQj7q7 OVEHXIA4botsjpXlTlPKGzmDyOlF9ANKCUGQUXTCYjAqatAaGXiHS9kmvWmkqctmQ0/4 9tNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=W3SkDLx6; dkim=pass header.i=@linaro.org header.s=google header.b=vz2Y+1UV; spf=pass (google.com: domain of libc-alpha-return-102031-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102031-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 o4si4978054pgp.476.2019.05.16.08.13.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 08:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-102031-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=W3SkDLx6; dkim=pass header.i=@linaro.org header.s=google header.b=vz2Y+1UV; spf=pass (google.com: domain of libc-alpha-return-102031-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-102031-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:in-reply-to :references; q=dns; s=default; b=bLyZYVSHMMRjusq/gjy3C6QEcCM/nV3 dS9Onozy4I3f0UNyhGlBfFbkDPPOcTUHzjbrrzka1UvUe9Vd97GX9sPBoWNpQ4xT l/a4pMaP97QWTMKR+vOX6ib1VAHNRWHOHoBczh9OcNoxFBL6QL/fLTwnSfeEfyDS IiBtS7Zo4dvg= 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=I6muWnBC3Cr+dTdbD/TFJ8nZcxA=; b=W3SkD Lx67OZGOL+tSiSr6afD+yJyrMSmOsKE1AioWTrkTgHxNPTImNI+n0Uz8ddpeSrvn LuUPCKjD+NYHrxQj4cp8Oog/jpRv/imc4C7witl2x4RECBULk+lMwrKPZvgDY3Be Jxm6nrXX7Q0bP+p6rjdSyNICufKYlWVcfOkMJE= Received: (qmail 112596 invoked by alias); 16 May 2019 15:13:09 -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 112540 invoked by uid 89); 16 May 2019 15:13:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-vs1-f66.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=bfa33/ZEuPBPvdlSrJzLcKQHFGevAMWx9pPJZqsAoFc=; b=vz2Y+1UVgRqu81m9jv4DJOH2MNdjgPddx2Mfg8ZyVqThJyRIniCO0OKOueub4lEWFt uoViVUpoGs2pFPZebSlk7vk4Yughr4Ie2Fw0JD8WGQhBcIkgC9PEOJGlxy8zKbtnr6/t 9xrW9/URqJfPvw9lLLYaUbji+TaeaBYX1Ua9SbUWxTLWbOWFkoUYzZcAhyzixkw8YtSB PuUif48WW6rL8GKliFOdVh+71bVqqhPx/iIZjGI5Mf1o6DmBam3wsuT/SNcanBaHbE3d p9smgTEw7Xr8baCQYC/xFXEzItt+FvKzSthujNCzXJiqCH0k9VPLHuuW8ZMyhgIQV1Fv lJpg== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 5/5] Update sysvipc kernel-features.h files for Linux 5.1 Date: Thu, 16 May 2019 12:12:49 -0300 Message-Id: <20190516151249.19029-5-adhemerval.zanella@linaro.org> In-Reply-To: <20190516151249.19029-1-adhemerval.zanella@linaro.org> References: <20190516151249.19029-1-adhemerval.zanella@linaro.org> Linux 5.1 adds missing SySV IPC syscalls to the syscall table for remanining one that still uses the ipc syscall on glibc (m68k, mips-o32, powerpc, s390, sh, and sparc32). However the newly added direct ipc syscall are different than the old ones: 1. They do not expect IPC_64, meaning __IPC_64 should be set to zero when new syscalls are used. And new syscalls can not be used for compat functions like __old_semctl (to emulated old sysvipc it requires to use the old __NR_ipc syscall without __IPC_64). Thus IPC_64 is redefined for newer kernels on affected ABIs. 2. semtimedop and semop does not exist on 32-bit ABIs (only semtimedop_time64 is supplied). The provided syscall wrappers only uses the wire-up syscall if __NR_semtimedop and __NR_semop are also defined. Checked on x86_64-linux-gnu and i686-linux-gnu on both a 4.15 kernel configure with default options and sysvipc tests on a 5.1.2 kernel with --enable-kernel=5.1. * sysdeps/unix/sysv/linux/i386/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS): Only undefine if [__LINUX_KERNEL_VERSION < 0x050100]. (__IPC_64): Likewise. * sysdeps/unix/sysv/linux/m68k/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/mips/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/powerpc/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/s390/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/sh/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/sparc/kernel-features.h (__ASSUME_DIRECT_SYSVIPC_SYSCALLS, __IPC_64): Likewise. * sysdeps/unix/sysv/linux/msgctl.c (__old_msgctl): Only use wire-up syscall if __IPC_64 is different than 0x0. * sysdeps/unix/sysv/linux/semctl.c (__old_semctl): Likewise. * sysdeps/unix/sysv/linux/shmctl.c (__old_shmctl): Likewise. * sysdeps/unix/sysv/linux/semop.c (semop): Only use wire-up if __NR_semop is define. * sysdeps/unix/sysv/linux/semtimedop.c (semtimedop): Likewise. --- sysdeps/unix/sysv/linux/i386/kernel-features.h | 10 ++++++---- sysdeps/unix/sysv/linux/m68k/kernel-features.h | 11 ++++++----- sysdeps/unix/sysv/linux/mips/kernel-features.h | 14 +++++++++----- sysdeps/unix/sysv/linux/msgctl.c | 5 ++++- sysdeps/unix/sysv/linux/powerpc/kernel-features.h | 11 ++++++----- sysdeps/unix/sysv/linux/s390/kernel-features.h | 11 ++++++----- sysdeps/unix/sysv/linux/semctl.c | 5 ++++- sysdeps/unix/sysv/linux/semop.c | 4 +++- sysdeps/unix/sysv/linux/semtimedop.c | 4 +++- sysdeps/unix/sysv/linux/sh/kernel-features.h | 11 ++++++----- sysdeps/unix/sysv/linux/shmctl.c | 5 ++++- sysdeps/unix/sysv/linux/sparc/kernel-features.h | 11 +++++++---- 12 files changed, 64 insertions(+), 38 deletions(-) -- 2.17.1 diff --git a/sysdeps/unix/sysv/linux/i386/kernel-features.h b/sysdeps/unix/sysv/linux/i386/kernel-features.h index 5a26328d97..e08af61501 100644 --- a/sysdeps/unix/sysv/linux/i386/kernel-features.h +++ b/sysdeps/unix/sysv/linux/i386/kernel-features.h @@ -46,10 +46,12 @@ # undef __ASSUME_SENDTO_SYSCALL #endif -/* i686 only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS -#undef __IPC_64 -#define __IPC_64 0x100 +/* i686 only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +#endif #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 8e81bb98ef..cec0be6b2b 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -53,10 +53,11 @@ # undef __ASSUME_SET_ROBUST_LIST #endif -/* m68k only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS - -#undef __IPC_64 -#define __IPC_64 0x100 +/* m68k only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +#endif #endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/mips/kernel-features.h b/sysdeps/unix/sysv/linux/mips/kernel-features.h index d90d87a5b0..2a7c125d5b 100644 --- a/sysdeps/unix/sysv/linux/mips/kernel-features.h +++ b/sysdeps/unix/sysv/linux/mips/kernel-features.h @@ -30,15 +30,16 @@ # undef __ASSUME_SET_ROBUST_LIST #endif -#undef __IPC_64 -#define __IPC_64 0x100 - /* Define this if your 32-bit syscall API requires 64-bit register pairs to start with an even-number register. */ #if _MIPS_SIM == _ABIO32 # define __ASSUME_ALIGNED_REGISTER_PAIRS 1 -/* mips32 only supports ipc syscall. */ -# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +/* mips32 only supports ipc syscall before 5.1. */ +# if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +# endif /* The o32 MIPS fadvise64 syscall behaves as fadvise64_64. */ # define __ASSUME_FADVISE64_AS_64_64 1 @@ -46,6 +47,9 @@ /* mips32 support wire-up network syscalls. */ # define __ASSUME_RECV_SYSCALL 1 # define __ASSUME_SEND_SYSCALL 1 +#else +# undef __IPC_64 +# define __IPC_64 0x100 #endif /* Define that mips64-n32 is a ILP32 ABI to set the correct interface to diff --git a/sysdeps/unix/sysv/linux/msgctl.c b/sysdeps/unix/sysv/linux/msgctl.c index 2d49567686..d45e00253b 100644 --- a/sysdeps/unix/sysv/linux/msgctl.c +++ b/sysdeps/unix/sysv/linux/msgctl.c @@ -61,7 +61,10 @@ int attribute_compat_text_section __old_msgctl (int msqid, int cmd, struct __old_msqid_ds *buf) { -#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + /* For architecture that have wire-up sysvctl but do not define __IPC_64 + to a value different than default (0x0), it means the old syscall was + done using __NR_ipc. */ +#if defined(__ASSUME_DIRECT_SYSVIPC_SYSCALLS) && __IPC_64 != 0x0 return INLINE_SYSCALL_CALL (msgctl, msqid, cmd, buf); #else return INLINE_SYSCALL_CALL (ipc, IPCOP_msgctl, msqid, cmd, 0, buf); diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h index b0fd94b139..7cfeaff946 100644 --- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h @@ -47,11 +47,12 @@ #include_next -/* powerpc only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS - -#undef __IPC_64 -#define __IPC_64 0x100 +/* powerpc only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +#endif #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS 1 diff --git a/sysdeps/unix/sysv/linux/s390/kernel-features.h b/sysdeps/unix/sysv/linux/s390/kernel-features.h index 12338c0090..c455cec1af 100644 --- a/sysdeps/unix/sysv/linux/s390/kernel-features.h +++ b/sysdeps/unix/sysv/linux/s390/kernel-features.h @@ -48,11 +48,12 @@ # undef __ASSUME_SENDTO_SYSCALL #endif -/* s390 only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS - -#undef __IPC_64 -#define __IPC_64 0x100 +/* s390 only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +#endif #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS2 diff --git a/sysdeps/unix/sysv/linux/semctl.c b/sysdeps/unix/sysv/linux/semctl.c index d428400681..a9d9ee74ec 100644 --- a/sysdeps/unix/sysv/linux/semctl.c +++ b/sysdeps/unix/sysv/linux/semctl.c @@ -98,7 +98,10 @@ __old_semctl (int semid, int semnum, int cmd, ...) break; } -# ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + /* For architecture that have wire-up sysvctl but do not define __IPC_64 + to a value different than default (0x0), it means the old syscall was + done using __NR_ipc. */ +# if defined (__ASSUME_DIRECT_SYSVIPC_SYSCALLS) && __IPC_64 != 0x0 return INLINE_SYSCALL_CALL (semctl, semid, semnum, cmd, arg.array); # else return INLINE_SYSCALL_CALL (ipc, IPCOP_semctl, semid, semnum, cmd, diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c index 119ee06878..61649e3f41 100644 --- a/sysdeps/unix/sysv/linux/semop.c +++ b/sysdeps/unix/sysv/linux/semop.c @@ -26,7 +26,9 @@ int semop (int semid, struct sembuf *sops, size_t nsops) { -#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + /* semop wire-up syscall is not exported for 32-bit ABIs (they have + semtimedop_time64 instead with uses a 64-bit time_t). */ +#ifdef __NR_semop return INLINE_SYSCALL_CALL (semop, semid, sops, nsops); #else return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops); diff --git a/sysdeps/unix/sysv/linux/semtimedop.c b/sysdeps/unix/sysv/linux/semtimedop.c index 1d746c4117..6bbca1e16f 100644 --- a/sysdeps/unix/sysv/linux/semtimedop.c +++ b/sysdeps/unix/sysv/linux/semtimedop.c @@ -27,7 +27,9 @@ int semtimedop (int semid, struct sembuf *sops, size_t nsops, const struct timespec *timeout) { -#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + /* semop wire-up syscall is not exported for 32-bit ABIs (they have + semtimedop_time64 instead with uses a 64-bit time_t). */ +#ifdef __NR_semtimedop return INLINE_SYSCALL_CALL (semtimedop, semid, sops, nsops, timeout); #else return INLINE_SYSCALL_CALL (ipc, IPCOP_semtimedop, semid, diff --git a/sysdeps/unix/sysv/linux/sh/kernel-features.h b/sysdeps/unix/sysv/linux/sh/kernel-features.h index 1f8e140232..1060d2fe8b 100644 --- a/sysdeps/unix/sysv/linux/sh/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sh/kernel-features.h @@ -41,11 +41,12 @@ before the offset. */ #define __ASSUME_PRW_DUMMY_ARG 1 -/* sh only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS - -#undef __IPC_64 -#define __IPC_64 0x100 +/* sh only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# undef __IPC_64 +# define __IPC_64 0x100 +#endif /* Support for several syscalls was added in 4.8. */ #if __LINUX_KERNEL_VERSION < 0x040800 diff --git a/sysdeps/unix/sysv/linux/shmctl.c b/sysdeps/unix/sysv/linux/shmctl.c index b322f205f8..5d9d9d15a7 100644 --- a/sysdeps/unix/sysv/linux/shmctl.c +++ b/sysdeps/unix/sysv/linux/shmctl.c @@ -63,7 +63,10 @@ int attribute_compat_text_section __old_shmctl (int shmid, int cmd, struct __old_shmid_ds *buf) { -#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + /* For architecture that have wire-up sysvctl but do not define __IPC_64 + to a value different than default (0x0), it means the old syscall was + done using __NR_ipc. */ +#if defined (__ASSUME_DIRECT_SYSVIPC_SYSCALLS) && __IPC_64 != 0x0 return INLINE_SYSCALL_CALL (shmctl, shmid, cmd, buf); #else return INLINE_SYSCALL_CALL (ipc, IPCOP_shmctl, shmid, cmd, 0, buf); diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h index 4cbe8399ac..11e1c8582a 100644 --- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h +++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h @@ -62,10 +62,13 @@ #endif /* sparc only supports ipc syscall. */ -#undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS -#ifndef __arch64__ -# undef __IPC_64 -# define __IPC_64 0x100 +/* sparc only supports ipc syscall before 5.1. */ +#if __LINUX_KERNEL_VERSION < 0x050100 +# undef __ASSUME_DIRECT_SYSVIPC_SYSCALLS +# if !defined __arch64__ +# undef __IPC_64 +# define __IPC_64 0x100 +# endif #endif /* Support for the renameat2 syscall was added in 3.16. */