From patchwork Tue Nov 8 20:29:56 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: 81395 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1742609qge; Tue, 8 Nov 2016 12:31:53 -0800 (PST) X-Received: by 10.98.139.72 with SMTP id j69mr26730731pfe.158.1478637113842; Tue, 08 Nov 2016 12:31:53 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id p129si38443310pfp.204.2016.11.08.12.31.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:31:53 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74535-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-74535-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74535-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=FuxcLgqC4552Uji8fMv0Kelct0t7DjU y3/i09wKXFk2XhiRtxeka/JMepEFuo/WW1fT96XwqpCU/MSt0oybmou9PKs8yIc7 U8SwpwSBTAgqejKO6zpi00HHCB+eWMiZKmf9hFr9KVvtuwq6fhbMDluw8IdFt9Jd iADOGEg4DHEo= 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=/q2GIrDJTIOETVvsxhLfiEXTm8Q=; b=HQuFU SuOn2cv26FJaGMo2ELsTO6lBi4pLL8zqC9YpDxA684AFxHPOSW67F2pMSYG8W0Wq TnzzKRBoLihOw1mPV7zIH11CXbqPhin+sWL1wBoYfEt/IqjOD6BankiFTOBW7vCf 8WWKvPmidfWs4Qnna9hOmRUKIA0rb6g66FxnQ4= Received: (qmail 124654 invoked by alias); 8 Nov 2016 20:30:40 -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 124390 invoked by uid 89); 8 Nov 2016 20:30:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=1613, UD:syscall.h, errnoh, microblaze X-HELO: mail-ua0-f182.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=lDik7+9HrU7G3R7EZ1aN/M7Z6OJ3Tz0Z6/NM0S2KrHQ=; b=PFx28UU4wnnUn4V9leY4wcl5GWtDiMaDON72jmlwcrSSuGaIfITCyovgoDK/ZQzob3 nph2QhXE49t1WQmyN/ZcpLcvDsXjBih9Fq3G8WKfxhNSIAkcAHXASuyKdR/vDSFSr8f8 s9nlyC3SAE6JRjapA/NSWaIshOkOjmxKFsrtfJqrNV0d+DpGxrOm1rVZKdyjaeynsxg/ NoG1/0eJmI/QK70GggniVlykemz4ulRtAflcCormBGEp39OMx8RlmZpjbk/0HdKRk7Xu RvCwmS8tfrRF4epbsvruc+c5bdqGNpUtofBmQ5EKa9onPwKVb6+vtCSrSCZFqVendlkY dNeg== X-Gm-Message-State: ABUngvdYnHUaE81zzKW9MM4/iZRdDmYvtVwOafkN2/XXbdQm9mqrQ7PpEGwIrXa1WlasrFjL X-Received: by 10.176.6.231 with SMTP id g94mr9364842uag.91.1478637027198; Tue, 08 Nov 2016 12:30:27 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v3 06/17] Use msgget syscall for Linux implementation Date: Tue, 8 Nov 2016 18:29:56 -0200 Message-Id: <1478637007-31212-7-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478637007-31212-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478637007-31212-1-git-send-email-adhemerval.zanella@linaro.org> Changes from previous version - Remove msgget from syscalls.list. -- 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/alpha/syscalls.list (msgget): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (msgget): Likewise. * sysdeps/unix/sysv/linux/msgget.c (msgget): Use msgget syscall if define. --- ChangeLog | 14 ++++++++++++++ sysdeps/unix/sysv/linux/alpha/syscalls.list | 1 - sysdeps/unix/sysv/linux/arm/syscalls.list | 1 - sysdeps/unix/sysv/linux/generic/syscalls.list | 1 - sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 - sysdeps/unix/sysv/linux/ia64/syscalls.list | 1 - sysdeps/unix/sysv/linux/microblaze/syscalls.list | 1 - sysdeps/unix/sysv/linux/mips/mips64/syscalls.list | 1 - sysdeps/unix/sysv/linux/msgget.c | 11 ++++++----- sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 11 files changed, 20 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index ced9c10..54c1752 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -1,6 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -msgget - msgget i:ii __msgget msgget shmat - osf_shmat i:ipi __shmat shmat oldshmctl EXTRA shmctl i:iip __old_shmctl shmctl@GLIBC_2.0 shmdt - shmdt i:s __shmdt shmdt diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index 43c464d..4bf4826 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -23,7 +23,6 @@ personality EXTRA personality Ei:i __personality personality # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index f65598a..ad75223 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # SysV APIs -msgget - msgget i:ii __msgget msgget semget - semget i:iii __semget semget semctl - semctl i:iiii __semctl semctl semtimedop - semtimedop i:ipip semtimedop diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index 3fbd81a..da2c9ab 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # semaphore and shm system calls -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 9edcbe6..8056781 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -5,7 +5,6 @@ umount2 - umount 2 __umount2 umount2 getpriority - getpriority i:ii __getpriority getpriority # semaphore and shm system calls -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index ed715ba..c40bac3 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -8,7 +8,6 @@ personality EXTRA personality Ei:i __personality personality # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list index fd84907..212392c 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -5,7 +5,6 @@ truncate - truncate i:si truncate truncate64 # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmdt - shmdt i:s __shmdt shmdt shmget - shmget i:iii __shmget shmget 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 } diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 259bdfc..f23b379 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names # semaphore and shm system calls -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index 1f04176..53ead93 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -2,7 +2,6 @@ arch_prctl EXTRA arch_prctl i:ii __arch_prctl arch_prctl modify_ldt EXTRA modify_ldt i:ipi __modify_ldt modify_ldt -msgget - msgget i:ii __msgget msgget shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt