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: 17123 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(-) 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 }