From patchwork Tue Dec 27 14:01:25 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: 89088 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp5000219qgi; Tue, 27 Dec 2016 06:04:49 -0800 (PST) X-Received: by 10.84.128.46 with SMTP id 43mr67358466pla.100.1482847489659; Tue, 27 Dec 2016 06:04:49 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id e11si46496952pgp.204.2016.12.27.06.04.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 06:04:49 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-76365-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-76365-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-76365-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=YqJhEtZNyShX3I+h5+QfoxMAp2E4wbD XElK33e8zQ2fmHGlD0rGwRwkY/cNpx+1IJY6pu7lT43tOwK0dPzPSBupM9dY6ENq 5H4hrpwu1CvP/Cxq+pmvh0e5wOw05ztfhPkejvfc4F8AQvLESv8uXnkFBd56Dk4a AyAu+MyH86ws= 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=RyVYW4L8eMn9npFwJV8FrxftMI8=; b=UADe1 Qfd0Fdta8yhXiK+HwHf7y8HgRjEhMZYsBpEs19gYLAm3VEToljUIoMhs6VX5hSi8 aqGsOok18jSahfLOhsH1deon6BKpTgknXT5u6Gvwpp4MPfAltXZ/ggFzV/MteT/h 6cA3dWJNlYqchkMlxVlObHzxu3k1m8Pzpn8w1w= Received: (qmail 79798 invoked by alias); 27 Dec 2016 14:02:22 -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 78268 invoked by uid 89); 27 Dec 2016 14:02:07 -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=2110, socket X-HELO: mail-yw0-f173.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=q1ZUUd9KKqxtEUaf0HprxWAMwkgZrvVstc05aqEkYgo=; b=er1YKI4KDLbREnM3s8bpU+7Epyheq4DrVsfn8Djmdtmebfbe3HHwm66dIHTeVbscjo Kf8RUlWBf6fxXgNhyhc2il2zsl4QTynXgvedFll4n5l3iFYsW1FRVOjB5fX/pg7JDwFZ PPlQTSN3KD9oBrhWxLlGCR7s7Umq2xEXzrzznJuKBHrDkPIUIjD0r0m5NnBR2AqEq/3F D/H4+Y5YNRTn/D8Hk1NxE5aZzdg7Np9x4IBQdynDxik2o2NxevKLtOYAEQWjGxHVoW3i rbcTih9OmAEiFmYpYonZac82exUQgjBQb/t2ubHoyfpXZwGx704j3bP9PvBH2tcrzcnS yrkg== X-Gm-Message-State: AIkVDXKx8lKrcHQzHTKuOX0IfdoGM0GXHfcPCOQqPcla0F/4/cH8aR4+lUtI85Srj1Y91sKQ X-Received: by 10.129.125.215 with SMTP id y206mr24060911ywc.234.1482847314500; Tue, 27 Dec 2016 06:01:54 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 16/17] Use shmget syscall for linux implementation Date: Tue, 27 Dec 2016 12:01:25 -0200 Message-Id: <1482847286-29933-17-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 shmget syscall if it is supported by kernel features. Checked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/alpha/syscalls.list (shmget): Remove. * sysdeps/unix/sysv/linux/arm/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/generic/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/hppa/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/microblaze/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list (shmget): Likewise. * sysdeps/unix/sysv/linux/shmget.c (shmget): Use shmget syscall if it is defined. --- ChangeLog | 14 ++++++++++++++ sysdeps/unix/sysv/linux/alpha/syscalls.list | 2 -- sysdeps/unix/sysv/linux/arm/syscalls.list | 4 ---- sysdeps/unix/sysv/linux/generic/syscalls.list | 3 --- sysdeps/unix/sysv/linux/hppa/syscalls.list | 3 --- sysdeps/unix/sysv/linux/ia64/syscalls.list | 3 --- sysdeps/unix/sysv/linux/microblaze/syscalls.list | 4 ---- sysdeps/unix/sysv/linux/mips/mips64/syscalls.list | 5 ----- sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list | 4 ---- sysdeps/unix/sysv/linux/shmget.c | 13 +++++++------ sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 - 11 files changed, 21 insertions(+), 35 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/syscalls.list delete mode 100644 sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 096bf22..4001020 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -1,7 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -shmget - shmget i:iii __shmget shmget - sigstack - sigstack 2 sigstack getpriority - getpriority i:ii __getpriority getpriority diff --git a/sysdeps/unix/sysv/linux/arm/syscalls.list b/sysdeps/unix/sysv/linux/arm/syscalls.list index b1ea664..0263eee 100644 --- a/sysdeps/unix/sysv/linux/arm/syscalls.list +++ b/sysdeps/unix/sysv/linux/arm/syscalls.list @@ -21,10 +21,6 @@ fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark personality EXTRA personality Ei:i __personality personality -# Semaphore and shm system calls. msgctl, shmctl, and semctl have C -# wrappers (to set __IPC_64). -shmget - shmget i:iii __shmget shmget - # proper socket implementations: accept - accept Ci:iBN __libc_accept __accept accept bind - bind i:ipi __bind bind diff --git a/sysdeps/unix/sysv/linux/generic/syscalls.list b/sysdeps/unix/sysv/linux/generic/syscalls.list index 51ce148..3bb5473 100644 --- a/sysdeps/unix/sysv/linux/generic/syscalls.list +++ b/sysdeps/unix/sysv/linux/generic/syscalls.list @@ -1,8 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -# SysV APIs -shmget - shmget i:iii __shmget shmget - # Socket APIs socket - socket i:iii __socket socket socketpair - socketpair i:iiif __socketpair socketpair diff --git a/sysdeps/unix/sysv/linux/hppa/syscalls.list b/sysdeps/unix/sysv/linux/hppa/syscalls.list index e75dd43..6d47b11 100644 --- a/sysdeps/unix/sysv/linux/hppa/syscalls.list +++ b/sysdeps/unix/sysv/linux/hppa/syscalls.list @@ -1,8 +1,5 @@ # File name Caller Syscall name # args Strong name Weak names -# semaphore and shm system calls -shmget - shmget i:iii __shmget shmget - # proper socket implementations: accept - accept Ci:iBN __libc_accept __accept accept bind - bind i:ipi __bind bind diff --git a/sysdeps/unix/sysv/linux/ia64/syscalls.list b/sysdeps/unix/sysv/linux/ia64/syscalls.list index 5ebade1..dd07db3 100644 --- a/sysdeps/unix/sysv/linux/ia64/syscalls.list +++ b/sysdeps/unix/sysv/linux/ia64/syscalls.list @@ -4,9 +4,6 @@ umount2 - umount 2 __umount2 umount2 getpriority - getpriority i:ii __getpriority getpriority -# semaphore and shm system calls -shmget - shmget i:iii __shmget shmget - # proper socket implementations: accept - accept Ci:iBN __libc_accept __accept accept bind - bind i:ipi __bind bind diff --git a/sysdeps/unix/sysv/linux/microblaze/syscalls.list b/sysdeps/unix/sysv/linux/microblaze/syscalls.list index 7a5666f..932c9cc 100644 --- a/sysdeps/unix/sysv/linux/microblaze/syscalls.list +++ b/sysdeps/unix/sysv/linux/microblaze/syscalls.list @@ -5,7 +5,3 @@ cacheflush EXTRA cacheflush i:iiii __cacheflush cacheflush prlimit64 EXTRA prlimit64 i:iipp prlimit64 fanotify_mark EXTRA fanotify_mark i:iiiiis fanotify_mark personality EXTRA personality Ei:i __personality personality - -# Semaphore and shm system calls. msgctl, shmctl, and semctl have C -# wrappers (to set __IPC_64). -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 deleted file mode 100644 index e8e381b..0000000 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ /dev/null @@ -1,5 +0,0 @@ -# File name Caller Syscall name Args Strong name Weak names - -# Semaphore and shm system calls. msgctl, shmctl, and semctl have C -# wrappers (to set __IPC_64). -shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list deleted file mode 100644 index 0ccbffa..0000000 --- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list +++ /dev/null @@ -1,4 +0,0 @@ -# File name Caller Syscall name # args Strong name Weak names - -# semaphore and shm system calls -shmget - shmget i:iii __shmget shmget diff --git a/sysdeps/unix/sysv/linux/shmget.c b/sysdeps/unix/sysv/linux/shmget.c index bd624fc..2cea696 100644 --- a/sysdeps/unix/sysv/linux/shmget.c +++ b/sysdeps/unix/sysv/linux/shmget.c @@ -16,13 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include -#include +#include #include -#include /* for definition of NULL */ - #include -#include +#include /* Return an identifier for an shared memory segment of at least size SIZE which is associated with KEY. */ @@ -30,5 +27,9 @@ int shmget (key_t key, size_t size, int shmflg) { - return INLINE_SYSCALL (ipc, 5, IPCOP_shmget, key, size, shmflg, NULL); +#ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS + return INLINE_SYSCALL_CALL (shmget, key, size, shmflg, NULL); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmget, key, size, shmflg, NULL); +#endif } diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list index cb1a9f9..45d5ebf 100644 --- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list +++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list @@ -6,7 +6,6 @@ pread64 - pread64 Ci:ipii __libc_pread __libc_pread64 __pread64 pread64 __prea preadv64 - preadv Ci:ipii preadv64 preadv pwrite64 - pwrite64 Ci:ipii __libc_pwrite __libc_pwrite64 __pwrite64 pwrite64 __pwrite pwrite pwritev64 - pwritev Ci:ipii pwritev64 pwritev -shmget - shmget i:iii __shmget shmget syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime