From patchwork Tue Nov 8 20:30:06 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: 81407 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1743603qge; Tue, 8 Nov 2016 12:34:13 -0800 (PST) X-Received: by 10.99.168.10 with SMTP id o10mr9311596pgf.152.1478637253488; Tue, 08 Nov 2016 12:34:13 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id x64si38535886pfk.4.2016.11.08.12.34.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Nov 2016 12:34:13 -0800 (PST) Received-SPF: pass (google.com: domain of libc-alpha-return-74545-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-74545-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74545-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=SvfdXUZVnUC9w0LonqdvE/XXdr7Gw0V TQajKN1GTNciTGx+f5Vh56//z57S4VR7nfjMq9NDz92B+tOSOg4LLQCIByylr71G rGdSivwVnhMdBLi0qG84NMOUWn4NdNPwHDOyII77IcrvladiWcvCqCY3pZ4qf3CW t9+1FDCBnsFc= 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=l2iBbSwQLDH6LZsCcwk0y3QwgLA=; b=ROyRg Shav4cfblXg3YNnIDSZ42L/IwWbOCKz/u/7tpORNuC8xk9O7f3aaDRy5/UJxiPhM 3/ndZ9frg86SxpjII2V3zp0P4WPgqOFzirC8k8hPwilpsP+bRItmZoqlYvaTIRDg P9I5ZtTS8bVajgDI8Ky402KHnI4N5uIAPKJxg4= Received: (qmail 125974 invoked by alias); 8 Nov 2016 20:30:51 -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 125548 invoked by uid 89); 8 Nov 2016 20:30:46 -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, s39064, sk:syscall X-HELO: mail-vk0-f50.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=ntYGv+lDuAaPbTKD34W4A+JF4hPrqb9x97efrbuU6gE=; b=Fpk0SuLsfpjFjYtQOjeJ1BMroSzOu1V9CN3OEqgXTfATYLtkxyE1a/8U4aCGfqHSoH 7Uq4rUdI7CUvS5HnFvuhjNMFMoUjxSWtnu7R0pd1e1Vw7dIoEpCKM9R8oNvnILIteTSF ub5eZIKs2YauE8ZY8fQa3k97dz+nrXisthdcKppAAxKba/NUQGiAF9RHTkLf1MJKhi3o AlPABNmD9l8/mcKMRZ1vIBqgJRUkUmlkn3dbxSPP4BgWbrHP5pQmlHA+1KhjpwwZHAo+ sPleNAD9yEyx8DxOymGuGvh7RnmzUp6TpdrzLsE271sKud3MfghcoUJHxxGE/aY4U3cd OBBA== X-Gm-Message-State: ABUngvdiaF+V2V3Je5c2RDeVIwb607f9EPxSors3ujSm5oIv1z9/gdO/NJYxsjySYBj2FY7Y X-Received: by 10.31.192.136 with SMTP id q130mr9888910vkf.138.1478637039053; Tue, 08 Nov 2016 12:30:39 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v3 16/17] Use shmget syscall for linux implementation Date: Tue, 8 Nov 2016 18:30:06 -0200 Message-Id: <1478637007-31212-17-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 shmget from syscalls.list. -- 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 | 4 ---- 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(+), 34 deletions(-) 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 index 461b4ef..536efc6 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list +++ b/sysdeps/unix/sysv/linux/mips/mips64/syscalls.list @@ -2,7 +2,3 @@ ftruncate - ftruncate i:ii __ftruncate ftruncate ftruncate64 __ftruncate64 truncate - truncate i:si truncate truncate64 - -# 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..c3e6c90 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_SYSVIPC_SYSCALL + 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 65a03ff..51a9177 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 -shmget - shmget i:iii __shmget shmget syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime