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: 80539 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp291771qge; Wed, 2 Nov 2016 12:29:13 -0700 (PDT) X-Received: by 10.99.7.210 with SMTP id 201mr8071250pgh.51.1478114953093; Wed, 02 Nov 2016 12:29:13 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c7si3911679pao.319.2016.11.02.12.29.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 12:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74325-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-74325-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74325-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=cr0dCh4SdWmJIAvrQHDaednHzE+7qCb 0mqY6HawV7etsfudf7MeLrju4EZY22AUPq7karhfz9lcLgK91hGDCNayPTs44poJ HXUqN/rNrpd4+sQ6gW9+yfh6+QXkr1hXWsBv7g6D/0ioIL4inPo7G2ZbOeNAb44n lvxugxiZYmJQ= 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=erv/cV0osN5ZWpGJrGdkWT94utM=; b=WHqNH lx0mOMYhpGBbKOsYxlDl+VoEwrplxe/8zgy3zI7wcpL260q7D0L1cMjjgbGyd6zW TUo78M4oF6SSKYhprJUh2hPip9caTHDmsVGCsXvniVMuXtOBUURcn5jl6St3rnHL lhglIkNxFtiLZW0N6yta7K6g6LTLQ/qDhFhw4c= 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(-) -- 2.7.4 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 }