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 X-Patchwork-Id: 689923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t7YTJ61WQz9t2G for ; Wed, 2 Nov 2016 01:27:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=m0JCmUMl; dkim-atps=neutral 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=BuEf1JoQeIPEU0NHGzGM4tOdh7JlAu+ RhnqbuCwFaUNWP3/89rt7fm0GWCbjruGL+WqdGrRnapsAnv8z03h/7q6WBTrMvOs FmICi9nkQBt6zyh11L4fKxQrOGZMN+TsE79y+uzpCrPf5UYkiPpexd47ise2MBTu f0h8FA+cmTRY= 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=gOimqy/AbNSDfZ2kASlVvPmwmCQ=; b=m0JCm UMlH12S8UVJODiPqcZGHrPk76jnKyPMxGGLJAD9YFPV+xdpUd/YzO86BlJLokiXq i2eCAYl2eQIHNS3roF8dxQTpsSo8cLVLliLl0tPZGgZK/6vGf/jL01GyObyaNVdg 5C4kLUIN+v17+xxz/3dM/KYs7BmPwRE678qwWg= 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 }