From patchwork Tue Nov 1 14:25:15 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: 17070 Received: (qmail 36506 invoked by alias); 1 Nov 2016 14:25:45 -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 36381 invoked by uid 89); 1 Nov 2016 14:25:44 -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=KEY X-HELO: mail-ua0-f173.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=/EeTLV2VFnWh6CncEMpr15cUFJenBeahvnF0GE0xoYc=; b=gD3DA4hHJ37Qy9bCK0dJAgo/QUcrJ1wgF5cLMm3CdKNiutfJoqfte9SEzOf4RSoK2A J4VeWoWYkQ/rRp5Pu4Xf+Xb4FzS4gWyZvO8DY17VyIlutMULkNj4oVjY907toMljOaFc 3uLgk9Sn4NpL8nzAX+nWdfDKoWqHZJHvalhRcluGp9xoEOxCPjMsKCBWkbW207zTrliI tW42Nu31le/ONE3QfgQd/l1LFr6cBEvqI4ANGNov5rZh2CNuacOPz7TePwR6rCnVmD0V nfrptWkKUGPnta4HhAOxfOoDGuX25QhcunMAfWM5Ut6/SWC0nGDY9/gXp8mFLjSw9ly/ ldSg== X-Gm-Message-State: ABUngvcq4HyNU+FL4sJeaXayohLDW/OTiGRVH1NEHOOqreq4Ho0CpKPD4c/SfJhV98jBr9// X-Received: by 10.176.80.14 with SMTP id b14mr24397039uaa.132.1478010339015; Tue, 01 Nov 2016 07:25:39 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 07/15] Use semget syscall for Linux implementation Date: Tue, 1 Nov 2016 12:25:15 -0200 Message-Id: <1478010323-13076-8-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 semget syscall if it is defined by kernel headers. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/semget.c (semget): Use semget syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/semget.c | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/semget.c b/sysdeps/unix/sysv/linux/semget.c index 52189fd..739346b 100644 --- a/sysdeps/unix/sysv/linux/semget.c +++ b/sysdeps/unix/sysv/linux/semget.c @@ -16,13 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include #include #include -#include /* for definition of NULL */ - #include -#include +#include /* Return identifier for array of NSEMS semaphores associated with KEY. */ @@ -30,5 +27,9 @@ int semget (key_t key, int nsems, int semflg) { - return INLINE_SYSCALL (ipc, 5, IPCOP_semget, key, nsems, semflg, NULL); +#ifdef __NR_semget + return INLINE_SYSCALL_CALL (semget, key, nsems, semflg); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semget, key, nsems, semflg, NULL); +#endif }