From patchwork Tue Nov 1 14:25:16 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: 17074 Received: (qmail 36824 invoked by alias); 1 Nov 2016 14:25:46 -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 36356 invoked by uid 89); 1 Nov 2016 14:25:43 -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=sops, 1617 X-HELO: mail-vk0-f46.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=hSkzzU+05CY6WHtigjOEFfBj9ahs7WwDtxHhRc+4Fyk=; b=XUmDxbPUWvbS2N8M6IE7rQHraa4b9CgJEjKQlY7x7ZXoGBy9IC6w95MOWI9fv4Uoji DQJsQ31/OhOxHhfP9lEcveySi78SyMC4AXAotVCw+lSOcZ1FVlMyJkb2nBn0C8mdNHg0 y4I0GJYHCTYaVw0sgrGuRaGJKPpKuezLLLeTy3FuKAluAKfY3KcaFpjkOimK+BkdjO1K W2RjyBb2CENxfrZKD+tvLmXsXQAPHERtxFlCW+gLH/k8LTafJE+MNO+7Xx2q4zQVLPQo h8UxbJnMr8AnhNH6egaezLIwFPaMIIVoBjQZLiy+19hS+WsGXtjWNR/9DxYuaWp9mCxb 3AUw== X-Gm-Message-State: ABUngvfOSnnU8W9AyD6AOWD4FhgTHafLzvpdvo6OG1zSlfiuWNxNhyBkha/JyRAbw5QFat1A X-Received: by 10.31.16.165 with SMTP id 37mr6032210vkq.174.1478010340193; Tue, 01 Nov 2016 07:25:40 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 08/15] Use semop syscall for Linux implementation Date: Tue, 1 Nov 2016 12:25:16 -0200 Message-Id: <1478010323-13076-9-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> References: <1478010323-13076-1-git-send-email-adhemerval.zanella@linaro.org> This patch add a direct call to semop syscall if it is defined 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..1c27539 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 __NR_semop + return INLINE_SYSCALL_CALL (semop, semid, sops, nsops); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_semop, semid, nsops, 0, sops); +#endif }