From patchwork Tue Nov 8 20:29:55 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: 81393 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1742443qge; Tue, 8 Nov 2016 12:31:30 -0800 (PST) X-Received: by 10.99.137.66 with SMTP id v63mr21373571pgd.117.1478637090215; Tue, 08 Nov 2016 12:31:30 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e2si32094823pav.323.2016.11.08.12.31.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:31:30 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74533-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-74533-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74533-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=JYhSFH+91tXHHh/a0VWGgq7PClGCy48 5MKeHSW/aZUXcOTINL7fOdHR22kOyLuLBK6y3JP4fdeKKBequcr5+6Tu/Jw9Kklk ZWvH0EEUnC8Lo/TDvcD+dMwEZwhEhrcMFEwhB7IfLl8nIb67i5JfgL5vjSyuGN96 CdajZSezGi0w= 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=20ZIxfUNbdhP9IoI0aJKExM5+w0=; b=AxxZ0 LVxtO6id3zwGaqkbcfGVvRPJkWFPoqeypy6CZXE/lVrCHXrywmoOIeGFOmZbk9jw tSw7zIIggljmJsHYecqQAlhZUt08hfxEjeJ1xPlvmeT21fl6X8P/SZDnVlnBkRq6 0ZUCnQpVRUCL9SdBXXfhWY9sm7dMZIczQsqzqE= Received: (qmail 124538 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 124383 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=96, weak_alias, 9, 6, UD:sysdep-cancel.h X-HELO: mail-ua0-f172.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=P8j5iF1+WNCCACjdHAxWeR9xyUztt2wgVfmSHKr1gM8=; b=HBgOi5KN2zW1L8TGCM/jQEDl+HhUHqgPNwnWAf88PYufP55eGPdxoDOhE3V/wJNhlg Sqqw7NeqKh62QXcGaWRpAEpRExK1ITYgyF/4s8N4OkIZwtc5J/o/fiwpI+/dMnsyzeNs +lKYXPBoME3Mc0OZs77Tjr0zKjCf06bUBNLLWoznXqYVCLh4/Ywp+vTlfRPvHmtsduDN f9i6U92m0bHCcnBBnCzGyzaxkmkGbTFZkyzvhIjH28CcH9gxIlD4HvkQLo4g9bSIRk5E LjqSuSEHKG3wh2k6W7+LdBFk5nLJkFQN6Uv44Othhv2pq8X7mbMDP1CuqHryqNyn5rRW IiuA== X-Gm-Message-State: ABUngvdJBTL9CvIs07MEB31mO+RiDnt/c5HQ48NqKRLF10Xs7fwT7EDe2nB27H95zGDVYe/t X-Received: by 10.176.65.195 with SMTP id 61mr7408393uap.144.1478637026052; Tue, 08 Nov 2016 12:30:26 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v3 05/17] Use msgsnd syscall for Linux implementation Date: Tue, 8 Nov 2016 18:29:55 -0200 Message-Id: <1478637007-31212-6-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 msgsnd from syscalls.list. -- 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 | 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 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 1f06389..fd84907 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -6,7 +6,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 -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..7349786 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 -#include int __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) { +#ifdef __ASSUME_SYSVIPC_SYSCALL + 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 945f084..1f04176 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 shmat - shmat i:ipi __shmat shmat shmctl - shmctl i:iip __shmctl shmctl shmdt - shmdt i:s __shmdt shmdt