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: 689924 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t7YTV3Z5Jz9t2D for ; Wed, 2 Nov 2016 01:27:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=ec2sM06y; dkim-atps=neutral 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=VJFOhNdv0DOyNzEVBSSfcrFOAd9USGy D61BhlwKLiO8ODerZhFubA3zZhTTUaRKC2syeAvEpBcWHVjt3FsqjJ4KWhUFsEqk Y9FRcCSJx/LZUutBHSKHjQeX5TWAbJqdN3yiQysRAxrQmQi0Qr8/2T6PTZqZmcPL 7QoAdt/UEds0= 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=n/SOP8AmlVxssWUESm3u3FDFZBI=; b=ec2sM 06yR2NFhkw8sv4858y/zy6NzFWj0QS3Oz9rMCbYmIQ+8VOkuT0N/bBObvj3uLq14 TXPqQJSzIYTNBxw1GDck2KWlKWVgueiUh9/mugdCfYTLMfKKQFuO5N13/CGytz9W kC0HjJ6mPuwwpD2NG98iN4TZtdZLqaJ/7ozolM= 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 }