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: 80535 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp291500qge; Wed, 2 Nov 2016 12:28:28 -0700 (PDT) X-Received: by 10.99.213.21 with SMTP id c21mr8125464pgg.176.1478114908771; Wed, 02 Nov 2016 12:28:28 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id bi5si3975729pab.4.2016.11.02.12.28.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 12:28:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74321-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-74321-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74321-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=Vrl5LfQjrChFH62iPm077keRCUGKVwP XXzFT5y0LsT2T0K45c5rJ51ii9o+5yWiOt9MeCK07Hb60rbIrvendpxXWEBdBMRP O1RVQfucMsPH9DPVJDY5FRdlecUS7sBzmwiYMA8j7jIneatknDxHwqASGq/YxdSN kAA17YQSlDxU= 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=WEOoiIS2pOzfPKTF8srPSzRh55s=; b=wyuNB 3l1Wlv3x8Hn3nwdFuNZHdgtI8NcCiWXRArPC8aNUqAKNs7ZznycBQIh6kix+EcKF J07djj94tyHaPOPky3xW3LGFfYO3mNOVdNBz1WiI/5y/2AZrsYG82ZKIq8tXhU2g 5seihoaXt5tRnTODFNgS4guLWstVC/KCM5utnk= 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(-) -- 2.7.4 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 }