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 X-Patchwork-Id: 17081 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(-) 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 }