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: 80356 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp677700edx; Tue, 1 Nov 2016 07:26:21 -0700 (PDT) X-Received: by 10.99.152.25 with SMTP id q25mr50273324pgd.36.1478010381815; Tue, 01 Nov 2016 07:26:21 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id dz8si25694136pab.18.2016.11.01.07.26.21 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 07:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74259-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-74259-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74259-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=q5AJpFVBULU+fvQWqgDx+SfAviY5SXl LPcJBVjnmK0u5djgI0M2Yfv0btdOugEX30qjWGRXe8C9nZQ1jNI+SeZ/V/diO74t i/0kTqLJ+fanLChPLoen/uUWJ8FjBMESXRwsoEJ8dGm/7a38BrksG1+kWYmBebIY zIC69cOPkOmQ= 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=8Q9wlA6GpVOZ95aDOIYZZES1krY=; b=REF4C 3kPnSAbZxqEaMfiznWps+zbNCktA+gRyzkQ+2mFcQ5RxDWYpdy9RTjNa4sE4LEiy faWVaMMW8rKxTeeq1g5mCIEysCUg8Ol8LWtNe19Gd3E1zGlc1Qqou6yi9k7/h3Nc S3SH0n2/ZNRA/hdlnCJnKCOlJlkitGHn7xT5j8= 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(-) -- 2.7.4 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 }