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: 80360 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp678060edx; Tue, 1 Nov 2016 07:27:06 -0700 (PDT) X-Received: by 10.98.68.90 with SMTP id r87mr60479774pfa.19.1478010426464; Tue, 01 Nov 2016 07:27:06 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u7si25637523pag.67.2016.11.01.07.27.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 07:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74263-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-74263-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74263-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=ZzVzhZPKBCJPeLsWtjYUqE5JV0VIKfK HqD1mxOf8mIZOkN6RhPIG2Ze23qy07USijhl7AV/ww1v9nDYF8EVXEkIQfkiypBl Qayb7NTvl8R3mxfinwrrDLwTG49uETR99FiEYWIkJhddPcpyPtSqXT5q8L2r3i8w paa3hcqSsPsM= 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=TUYwY aB7s/gapx5EPJ9nynj1+ukFZgOxomTyO9AWsY2hX7ImqithKmICfaxez8ABgaLL0 MvHmRK/gENhtG2Q/R28wsrsCi6aI/gj3Cs6q6Qy1hUgVRRuZL/tMbfDox5Gxiuoj glx3EpyqNRpHcaUwEYf+fv0zeUQ8kjezScR4Ko= 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(-) -- 2.7.4 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 }