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: 690553 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 3t8J6c419Lz9t2g for ; Thu, 3 Nov 2016 06:28:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=sjoBGX2/; 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=mucpKei4vI39p8vKo6l8Ggoy5P90ZAf umdywGbwduWWfrJzEBT73O0bqCAGEIqEeDZLcHArZ0+y4NOgavHkplAXJsNBF5W/ rIXJT4pTyGHpMDjiqVv2EV7JUPVi15jpV6/GSvyopg13F9VgMYA+ZnUFfqBgXQc4 oHz8X74JR02E= 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=sjoBG X2/byCBVUxkgEHjZapgl/dDZyOTCg+ZOY7YiZrfbg4bO7MhvM2HOs/5rlIXy/TWS Dy9qhKUwCQcjGM8oFiIviK2+kO+jssXGIqY/7BQRMqidbY+6ae/VK/8DKD4WAj0i ag7PWfrsptMC3cVr/pJMvjVGTrd3Z47SwBMMJo= 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 }