From patchwork Wed Nov 2 19:26:42 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: 17113 Received: (qmail 64549 invoked by alias); 2 Nov 2016 19:27:17 -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 64275 invoked by uid 89); 2 Nov 2016 19:27:16 -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=1613, H*MI:sk:1478114 X-HELO: mail-ua0-f178.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=AjkLJdJi9TklcswzyNbsjXMWPRrkuFZaPufmlpw7bWQ=; b=V/QQ+D8kGP0zFEBFA6V1AZKyYjMz5aBeDaH+1V9L8UdWgaRd4xuSv96W1VzD9evulx KPg+M3hmG5VXDo24HZVykI8uHLX0Jsa6d5cZXZdl3y9G8kwMTSELWnaGNX6kdj4wyoP+ 8lf/0o1FZI0KqReyv2nL4dtl8FJNZ2nvWn6TWwWyHjfy8x3cCukiPovWRg4aIBTyNIca 6OaZxSyF1wIvp4bR5mKH3YDjW2d93YVZLQOTtlTdwUHZyIEYQYyoA2NK3TufV/Fbz5J7 8VCMX++mMJ9kaW0Ej9C9roNPeWWrD1HnTkW2YyCo+bduCXwQTu966fsZ/hfz7y58uV4I /bGQ== X-Gm-Message-State: ABUngveIzZktF8N8vamJlPLB655lmYDeqQn7TgTxAE+hqni+MdKTl+/Nn3kSwD4Nqfp8wcwe X-Received: by 10.176.3.84 with SMTP id 78mr4148724uat.117.1478114827266; Wed, 02 Nov 2016 12:27:07 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 05/16] Use msgget syscall for Linux implementation Date: Wed, 2 Nov 2016 17:26:42 -0200 Message-Id: <1478114813-3526-6-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 msgget syscall if it is supported by kernel features. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/msgget.c (msgget): Use msgget syscall if define. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/msgget.c | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/msgget.c b/sysdeps/unix/sysv/linux/msgget.c index ef98c75..c00ebfd4 100644 --- a/sysdeps/unix/sysv/linux/msgget.c +++ b/sysdeps/unix/sysv/linux/msgget.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 descriptor for message queue associated with KEY. The MSGFLG parameter describes how to proceed with clashing of key values. */ @@ -30,5 +27,9 @@ int msgget (key_t key, int msgflg) { - return INLINE_SYSCALL (ipc, 5, IPCOP_msgget, key, msgflg, 0, NULL); +#ifdef __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (msgget, key, msgflg); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_msgget, key, msgflg, 0, NULL); +#endif }