From patchwork Tue Nov 1 14:25:12 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: 17075 Received: (qmail 36915 invoked by alias); 1 Nov 2016 14:25:46 -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 36383 invoked by uid 89); 1 Nov 2016 14:25:44 -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=KEY, Hx-languages-length:1310, HX-Gm-Message-State:ABUngvf X-HELO: mail-ua0-f173.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=JrEzQ2A4QbqgHePRb72C4ghqmeXtnhGGn4NTof7H69U=; b=HO5l+QAJ5FlwMzwZYnsNPJKXFeIybwBmWGT3c8SV+4Bad+X4SMCRNL8JCyPaGDF9Pn gK5UJ46ZzwWx7pNjUuqGKa/PUQF5rCBUb8c2kEz3jaPP7jyudiTdsl0qBtF9QD4WeV9M 1dGQrphLZFeqgx1i2k/URBPw4nXtDR+meocLymq9g9RZyRsLEQNa6ROiJb2t0QTmOXmH tU4mkxidtYkM9RGQ0gGBLXZKs6f0lCWfs6PV3bx91/uwZoMObSSuavZMwVDCd3o3L13K kU3qeBExzQihhLeDn2JjLq5chRx+x+gDL99Ol2FM7XwFTuUErZ5LFxohmQT0FtLPUwg8 n/TQ== X-Gm-Message-State: ABUngvf+G4Sfo0gVTOrx2oZlqkFrvI8Wlc5vLJXheDu4z1lNRd1RFJAcHjUzZ0DKitRVi8QS X-Received: by 10.176.84.7 with SMTP id n7mr16465529uaa.30.1478010335228; Tue, 01 Nov 2016 07:25:35 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 04/15] Use msgget syscall for Linux implementation Date: Tue, 1 Nov 2016 12:25:12 -0200 Message-Id: <1478010323-13076-5-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> This patch add a direct call to msgget syscall if it is defined by kernel headers. 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..07da793 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 __NR_msgget + return INLINE_SYSCALL_CALL (msgget, key, msgflg); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_msgget, key, msgflg, 0, NULL); +#endif }