From patchwork Tue Dec 27 14:01:15 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: 89077 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp4998982qgi; Tue, 27 Dec 2016 06:02:49 -0800 (PST) X-Received: by 10.99.140.77 with SMTP id q13mr58600258pgn.109.1482847369063; Tue, 27 Dec 2016 06:02:49 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a62si25825953pge.65.2016.12.27.06.02.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 06:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76354-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-76354-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76354-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=uPfx7y4gM83DoZ6nTy6loM+RZVOeYrm OIQSWrcBHm0EK5odOYhRKgPnhz90jB4/JKLNrRk4fq4gAtehigJ7gcSR9icI7jg1 MOWJK/lfqeLjBjdnOlXAlUvTKTjAYgLLeN4ObRXPcqXDOAH3JZL1tQrcFndblvqH pD6XyZlkZ9ro= 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=rSerJEnIhhbsXOb8GnIyMuF5RVY=; b=jsgp9 MsGy0kMj1asUH5lm/kdTsgh+ZV/6QjDx9AmCGTZWu0BlF3caf17Ux9LNDagRKL+L RZSxu3MP50asKmjMFWM00kErWgmgy/utmHrEudorKQcRPBrzLwMf3hRTxNtqtww7 suMBU2uVjVsPWc9kQn5ZIdV81j78EGbyDN+yoo= Received: (qmail 77076 invoked by alias); 27 Dec 2016 14:01:57 -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 77009 invoked by uid 89); 27 Dec 2016 14:01:56 -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=EXTRA X-HELO: mail-yw0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=iK/0Dy4f9hLbIBQgpD5HhO/ikCUQOwgy1h5Ll7NPy38=; b=YW+BCcrFB1jRTdg+FAloHMgedawBVAtNMgDevdRo1FkQE253TlL5v79LAfqjJx+jqG g2kAKJ2nUQokHUdjfEvXl4wMTVoa5kShdkmOv40VVlVDFkXVZPwDJZkAIhmH+xdA8XjN ywE5XYiokz4tdNLuxmMx3aMKBbZkDWDgcuwNt2P39V/oMgWf91sHcs6eowL7bKGTx/LQ iSCulbj1RlXp/zHjjK5iJdmGP4YDuC/G7r9TYMIBPuhYDY2A8NTaxItvc4f9uMQ+Scs/ dHlDui4gJkNUihySMNd1PLTdaj1R+UjaOC4owo2W20uN1pgb3aBKJwHVHHGTz++ThPt9 3OwA== X-Gm-Message-State: AIkVDXKyqt45IGYMDKtfNqls+uFpgv60XasScMfmNe3+SS5v7qDcKoI41jc2NwqvwG/vvMQ6 X-Received: by 10.13.199.135 with SMTP id j129mr24190201ywd.12.1482847301566; Tue, 27 Dec 2016 06:01:41 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 06/17] Use msgget syscall for Linux implementation Date: Tue, 27 Dec 2016 12:01:15 -0200 Message-Id: <1482847286-29933-7-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1482847286-29933-1-git-send-email-adhemerval.zanella@linaro.org> References: <1482847286-29933-1-git-send-email-adhemerval.zanella@linaro.org> 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 4c59a33..7c992d7 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -2,7 +2,6 @@ # 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..d487f04 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_DIRECT_SYSVIPC_SYSCALLS + 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 2d46bb3..75b25a1 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 pread64 - pread64 Ci:ipii __libc_pread __libc_pread64 __pread64 pread64 __pread pread preadv64 - preadv Ci:ipii preadv64 preadv pwrite64 - pwrite64 Ci:ipii __libc_pwrite __libc_pwrite64 __pwrite64 pwrite64 __pwrite pwrite