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: 689931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3t7YW30FTBz9t2D for ; Wed, 2 Nov 2016 01:28:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=ivu9qQQ7; dkim-atps=neutral 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=R72j0nt390FghSmZzBsrGyjC6WN+ryY /krFMPix6DkzjbYfz/z0nd7HRJNxNefnIfbKoVDIDM5KalE8ZDDW7VtP1SRmd3Q9 /lSNQVCoOmCjbG/7K+BYRl3m5ujPwCqwQe7LACWCwXQ9mXUt2JSvaHdpYwNS7N9g qzxpFKAAFWdo= 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=ivu9q QQ74NQdAInhf7fGKU3POgOCQq24vkuS+f0LGRM0gAoEoOjVPTqQ7PZ1av36ZWx1b SZm0B2k9SDseA6HbQir9dcsm4dsAFmj3s9LZ72bEokiDSr+pIdx1TBdoRu/2Am/L 9b6aboviDOL2awE90kMQ+m2TPaMYp2xb4+FIMI= 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 }