From patchwork Tue Nov 1 14:25:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 80368 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp678688edx; Tue, 1 Nov 2016 07:28:36 -0700 (PDT) X-Received: by 10.98.192.21 with SMTP id x21mr15244813pff.94.1478010516031; Tue, 01 Nov 2016 07:28:36 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id fe10si6746095pac.222.2016.11.01.07.28.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 07:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74271-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; spf=pass (google.com: domain of libc-alpha-return-74271-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74271-patch=linaro.org@sourceware.org; dmarc=fail (p=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=iKUVh+wlT1jaNtFa3BxM3WV8kWi/uvZ DCTagmt6QRI/rtKaPJvUYlNU8g5P9hj6ixMh3pfYNrTwDlhFPoa4ThvcLKC28xgM EWaBhweN5wYxqLiHyLfaHOBFhu3iGdKAWWXJe1xS8h3OsyDMaPjO1MsnQZaIonCK 7MR1TaYT+a+Q= 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=xz1xygmngzaTcrmQl3EbC+vpEts=; b=F/+Vv KFAG9AeC7DxVTDN9y9mLkMjNkzWmCiTrPl6mGZIn7W9yDpaprXpS00dTsZ9l3Pc3 wGvmJ6F+b4Uw8mUgC37Zn5/U5EqT4KnjK4yRDNeFDnjCCjVXcW0orRzzP3UyWl/i U5ByhdkoS6nv7c5j3RmI7nTr6xhfMZfRZzyulA= Received: (qmail 38652 invoked by alias); 1 Nov 2016 14:25:58 -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 37926 invoked by uid 89); 1 Nov 2016 14:25:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-vk0-f53.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=9scf46cZYk5WsL0757F4v2HIl8BiuVD9kx9K3i35ge4=; b=hPvE0mk+0FfoJt54aQvfPkcQuQFmptVkiU5aRNGaDCFjjhotSbXIjXgKjQXLKfOpwr 3Yme8dVx8icfx4odvZxHOyMEBSBIoZpJ0n6Qe4xzDVKFTIN712/iDvzfGnXA9rEp8Boj l5SNcMgnpToFJQOQQNoitnya8yLKGF/G5pXmYCFGWyvZoFXklRbxSVPv3DFqe9bjGRhO utlCmIDVHszdxzMx3fBW+nPOWeq6hBG1F6B2diA6SLCoVIMb197iLR9kHGQk9zIMS0PL upDPODHnl3VTu1zpLKPS103B8xRvP6XbOSyegecznxrvPGJSFpHTTp1d+G44UkpS/Dhh MzCg== X-Gm-Message-State: ABUngvexIlBA8LLbnNh8CF58pzaw7vgAMB7rdbUouyE2Vw5rolEm3Mk38WZrdu6DDiVrclHk X-Received: by 10.31.200.132 with SMTP id y126mr28085322vkf.126.1478010347136; Tue, 01 Nov 2016 07:25:47 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 14/15] Use shmget syscall for linux implementation Date: Tue, 1 Nov 2016 12:25:22 -0200 Message-Id: <1478010323-13076-15-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> this patch add a direct call to shmget syscall if it is defined by kernel headers. Checked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/shmget.c (shmget): Use shmget syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/shmget.c | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/shmget.c b/sysdeps/unix/sysv/linux/shmget.c index bd624fc..7024fc4 100644 --- a/sysdeps/unix/sysv/linux/shmget.c +++ b/sysdeps/unix/sysv/linux/shmget.c @@ -16,13 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include -#include +#include #include -#include /* for definition of NULL */ - #include -#include +#include /* Return an identifier for an shared memory segment of at least size SIZE which is associated with KEY. */ @@ -30,5 +27,9 @@ int shmget (key_t key, size_t size, int shmflg) { - return INLINE_SYSCALL (ipc, 5, IPCOP_shmget, key, size, shmflg, NULL); +#ifdef __NR_shmget + return INLINE_SYSCALL_CALL (shmget, key, size, shmflg, NULL); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmget, key, size, shmflg, NULL); +#endif }