From patchwork Tue Dec 27 14:01:14 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: 89078 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp4999125qgi; Tue, 27 Dec 2016 06:03:02 -0800 (PST) X-Received: by 10.98.18.6 with SMTP id a6mr29958058pfj.184.1482847382091; Tue, 27 Dec 2016 06:03:02 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id f1si46606858pld.130.2016.12.27.06.03.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 06:03:02 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76355-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-76355-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76355-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=G95Yx7BHI39YO4vdRdoOnHZ1Uj0qR7i Yx1I0590tSqc792FP/uOoUCSSLM6KcJdpLy0P2DfP0qD/uaSiXbRbL+v1fqoz0SG pY/P511etUow166XEXsfbeu/u7m4q1Z7zI3Ga1v3dN/X0+RH3cbKt2NVOC62i16j V/DorZlZ9f6s= 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=EEIvmaPOOye411crOme1wBu3U2k=; b=MYcF1 7aQZ3Nub5o2fk4535G9KCDrP4kRvinXiaOdkFeg41P+h7WSL0xHyzgvPtaU4kC3p 9QR7Vm8nLalpp7K8RghBzNjpkfiycoGSUoqwvs5luaDYp/oYSRJg8oJf6YD54/7i 3pU/2gNtI00hFqIGpVOUZopqJ5X4XtT/jZ8IIs= Received: (qmail 77110 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 77016 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=9, 7, 1617, EXTRA X-HELO: mail-yw0-f175.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=G6ezKHXujBGXAILJcdnnhLjyiWebsVrhZp1gZps8LLA=; b=bUwWYpJdEtcpaehbtn+7CJfCQTICuMHSgSg4Pey7Be0kDxNilvtvpcff7Bk4RbHLmd 7LuLHF74q9YH9RzHf097n3HSrxke5k/ATxwYkZ2SwV9PYfuOuBkYQ/oPrQ2RV3zK+Ehe WjzgHC1yQ6k8ZQeaX+25ZG42drqN7+H5KJeyycrsqoouLrBw2wMm4pJRaYBKqzl1Adgu q9NiVPDjgNBUWEyDDXU2W0EvIR7wthi+qJWS5tMTwugJA/zw+1m5RbD7VuHbeuXG+D41 2K+RBD/G1E4pTn48zQ0v8LO6s4ZSHqsIRll6MUfsOWXZ0X/xkhEIDfGM6gnGOCP53Wzd tSFw== X-Gm-Message-State: AIkVDXJOzZH+WwPdN7nugeLmtFmDU6gusoIaLdsVu0SZNVRAi+34Nvwah0QXPsUC54k7A8By X-Received: by 10.13.208.198 with SMTP id s189mr23930545ywd.315.1482847300294; Tue, 27 Dec 2016 06:01:40 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 05/17] Use msgsnd syscall for Linux implementation Date: Tue, 27 Dec 2016 12:01:14 -0200 Message-Id: <1482847286-29933-6-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 msgsnd syscall if it is supported by kernel features. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/alpha/syscalls.list (msgsnd): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (msgsnd): Likewise. * sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Use msgsnd syscall if defined. --- 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/msgsnd.c | 9 +++++---- sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list | 1 - sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 11 files changed, 19 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index ddbd672..ced9c10 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -1,7 +1,6 @@ # File name Caller Syscall name # args Strong name Weak names msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 297f7e7..43c464d 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -24,7 +24,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 -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 6869a48..f65598a 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -2,7 +2,6 @@ # SysV APIs msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 e4e40a0..3fbd81a 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -2,7 +2,6 @@ # semaphore and shm system calls msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 a60e615..9edcbe6 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -6,7 +6,6 @@ getpriority - getpriority i:ii __getpriority getpriority # semaphore and shm system calls msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 99dc33b..ed715ba 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -9,7 +9,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 -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 07b421d..4c59a33 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -3,7 +3,6 @@ # Semaphore and shm system calls. msgctl, shmctl, and semctl have C # wrappers (to set __IPC_64). msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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/msgsnd.c b/sysdeps/unix/sysv/linux/msgsnd.c index 1457e43..53cf3c1 100644 --- a/sysdeps/unix/sysv/linux/msgsnd.c +++ b/sysdeps/unix/sysv/linux/msgsnd.c @@ -16,17 +16,18 @@ License along with the GNU C Library; if not, see . */ -#include #include #include - #include -#include int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) { +#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + return SYSCALL_CANCEL (msgsnd, msqid, msgp, msgsz, msgflg); +#else return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg, - (void *) msgp); + msgp); +#endif } weak_alias (__libc_msgsnd, msgsnd) diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list index 59b93fe..259bdfc 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list @@ -2,7 +2,6 @@ # semaphore and shm system calls msgget - msgget i:ii __msgget msgget -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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 7192a96..2d46bb3 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -3,7 +3,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 -msgsnd - msgsnd Ci:ibni __msgsnd msgsnd 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