From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65229 invoked by alias); 2 Nov 2016 19:27:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 65150 invoked by uid 89); 2 Nov 2016 19:27:23 -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= X-HELO: mail-ua0-f181.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=6yzKFIr6Zayo29xT+H4DIYPeSVAZxUCBS33pBkpJdiE=; b=KnzOQCpCC9EBxQ+Y6jI0nUzo80+ZwNKccyR5D6l8UdvLqKK14PMdKhpDPd1MwjWh3A PPhOIGavcOQmf2XYCcX8nA/Hy8u/2c7pw3A+C8LWXcMhH8KU1tCssQ7ntXkOWtzJP2sx HVWHBZmWpxEHpxrNazwJZGtqby4co3vl+k+42yt+V6POQSLAl420S5trvkRyru5xlnxO NZVWvO8LAM+lq0qvy8zg+vV4hFw02k5M+Y0i7WvOYL/Cn7nt3kce9vmnTjomEAno5yzL m3+hsewPBgvaMBFaQkwOjMsttNTifsrbHrOr/vphcJdlgbCDbBI0I8mAUSNW62VpxYXp MbVQ== X-Gm-Message-State: ABUngveTPo0LoMNXxz6HpkE+yF5kHc6hq2hFxJK9FQ310EQbbWpBg2LdkM7yghFoiITeyNH/ X-Received: by 10.176.83.57 with SMTP id x54mr3700878uax.141.1478114832074; Wed, 02 Nov 2016 12:27:12 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 09/16] Use semop syscall for Linux implementation Date: Wed, 02 Nov 2016 19:27:00 -0000 Message-Id: <1478114813-3526-10-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478114813-3526-1-git-send-email-adhemerval.zanella@linaro.org> X-SW-Source: 2016-11/txt/msg00078.txt.bz2 Changes from previous version: - Use __ASSUME_SYSVIPC_SYSCALL instead of __NR_syscall to issue the wired syscall or the ipc one. -- This patch add a direct call to semop syscall if it is supported by kernel headers. Checked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/semop.c (semop): Use semop syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/semop.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sysdeps/unix/sysv/linux/semop.c b/sysdeps/unix/sysv/linux/semop.c index 593eb4c..bd57009 100644 --- a/sysdeps/unix/sysv/linux/semop.c +++ b/sysdeps/unix/sysv/linux/semop.c @@ -16,17 +16,19 @@ License along with the GNU C Library; if not, see . */ -#include #include #include - #include -#include +#include /* Perform user-defined atomical operation of array of semaphores. */ int semop (int semid, struct sembuf *sops, size_t nsops) { - return INLINE_SYSCALL (ipc, 5, IPCOP_semop, semid, (int) nsops, 0, sops); +#ifdef __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (semop, semid, sops, nsops); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops); +#endif } -- 2.7.4