From patchwork Wed Nov 2 19:26:45 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: 17117 Received: (qmail 65340 invoked by alias); 2 Nov 2016 19:27:25 -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 65159 invoked by uid 89); 2 Nov 2016 19:27:23 -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=Hx-languages-length:1435, 1613 X-HELO: mail-ua0-f180.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=uvaJAGyXNJMsJx2C1IjzzzaaUKdL79zOuLNxklNshv0=; b=a/G79f/xBai4y3fYUeWFSuM+hpcS6fcju6JA68XZ6HNcWp5cTlPUzNCHFyv2vhZc2e wONQeqsbqDazec7aJIst26lEo3uvQUh/S2e2TxsOO3RQ60Fg1T1tFL+pogJEGBAUc8i2 0YYehlHJIdN208Mu5NvSCyPdhOAqPKLl/Id7N+d4Nq79H1Z5kA0B0eAmpTzZ5XUPLUUm C8uPpkYhep/2B8aNz9NyegG977aYEMjvU/tahEtn7z5do7U3x8/8WBsBciRhsnQ6z+qw 45FIbi7IZ1P7evM/FnwrZzUCIyn70hxSbrQVZi7m2JUqWqCSGgGP7fXEmg7S1XzSTM9W gOJQ== X-Gm-Message-State: ABUngvf//0KLCChhp5fCMVstaKpfu73VJSAIs9ioqITCoWdJFn5Q6wBQFUFSpegBh0nWZ+XV X-Received: by 10.159.53.112 with SMTP id o103mr3731461uao.146.1478114830898; Wed, 02 Nov 2016 12:27:10 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 08/16] Use semget syscall for Linux implementation Date: Wed, 2 Nov 2016 17:26:45 -0200 Message-Id: <1478114813-3526-9-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version: - Use __ASSUME_SYSVIPC_SYSCALL instead of __NR_syscall to issue the wired syscall or the ipc one. --- This patch add a direct call to semget syscall if it is supported by kernel features. 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..efdd967 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 __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (semget, key, nsems, semflg); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semget, key, nsems, semflg, NULL); +#endif }