From patchwork Wed Nov 2 19:26:52 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: 80545 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp292216qge; Wed, 2 Nov 2016 12:30:23 -0700 (PDT) X-Received: by 10.99.184.25 with SMTP id p25mr8128857pge.120.1478115023018; Wed, 02 Nov 2016 12:30:23 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k6si4735105pgc.183.2016.11.02.12.30.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 12:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74332-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-74332-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74332-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=PBC8tYBxDdgM7o1Almdo6HO0kISYPb7 9asgDmJ58LM/f0w/S2RF5keskoBaS4G69ycDlqO1IZjmrqfOTQ2BzdTHHErPk4YW sq95CKWNQFBLCJbruZn+qxtyrRzfkuHw173yt1Z1uyI6Ra5S0xZGC6zJ9FbtakcC hQRdP4h9B3ns= 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=3coQ7J9nQsFgr835Y4HuVd2FaTE=; b=P/ELj 2zeRNeZNNaWddvrnTX206wh/D8q6gCHUtjzRK0AuJ07ahJHWWdOuV+/zbV6zV7SW 968lfqr254lKBz5zlelxqVB/gBiI1GqSctbxJNyQWYbQH8KpEWrl5K6IAuFdKEE8 OQUNNrNa+F9dOOnF5R8mw+tx0GcqXuRdkGNi0A= Received: (qmail 66021 invoked by alias); 2 Nov 2016 19:27:31 -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 65560 invoked by uid 89); 2 Nov 2016 19:27:26 -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:1500 X-HELO: mail-ua0-f174.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=Ei8Q7SFlL2j2C4L8Rv8sN3mw9NDfF9jOvmDFL61oAps=; b=KY7hfw1n34duWTLr8xNwkQsTa1SKJ3xfLbUxSrD749ipd5Ukspwrx9IuVF92UITyP7 McWiq0cBRKgnorc7zO9ZMW2Q/XAwZnyt0Ymn/Korg811EVhGol/lyzh60jeszlV9dpX3 NGF0FP1tjqEA80f6uQB53DLSW/AvKy4yvYQRaU6fUm7BlLdov9sV9qI4m++l+ArAM1I/ gRzi56WEyT2extsF5aGtQXsbpTu3bZXYQoTZYArPgPV035/zQy8qq928w6KH1GGEX5an VeOCznv13360rtgbZn77bScbSD3B6edx0pnzUUEyKeVf1Dx+Ym6xdkWxGinjMVeWh2Bm wcCg== X-Gm-Message-State: ABUngveymGxbrt00mO/KHXVqXahzlixDWWcGbgRyZIfIF9ZQGUQq9NL8dKKZURGEqufPRaD6 X-Received: by 10.176.3.84 with SMTP id 78mr4149557uat.117.1478114839039; Wed, 02 Nov 2016 12:27:19 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 15/16] Use shmget syscall for linux implementation Date: Wed, 2 Nov 2016 17:26:52 -0200 Message-Id: <1478114813-3526-16-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 shmget syscall if it is supported by kernel features. 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(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/shmget.c b/sysdeps/unix/sysv/linux/shmget.c index bd624fc..c3e6c90 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 __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (shmget, key, size, shmflg, NULL); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmget, key, size, shmflg, NULL); +#endif }