From patchwork Tue Nov 1 14:25:21 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: 80366 Delivered-To: patch@linaro.org Received: by 10.80.142.83 with SMTP id 19csp678532edx; Tue, 1 Nov 2016 07:28:14 -0700 (PDT) X-Received: by 10.98.141.4 with SMTP id z4mr31728044pfd.169.1478010494854; Tue, 01 Nov 2016 07:28:14 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id w63si30820508pgd.115.2016.11.01.07.28.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2016 07:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-74269-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-74269-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-74269-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=rRCH0b6412p7mJ2URSz6tgTws2CrWgB nsnUI/4mqrLPXUh9pLJmxDchqKVc8rHb1/3+N/o7A9R5rcUlEmZ/B2kMM3q1BrYF i0JrYdopAB2YD0WyFEZjygCzUHO+wAPSxKkrTax1LGv+Gkg2wYsMYDLq1euTVRy1 QJs+gAe2OCL0= 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=1WP01Jx9eQN8xH6Rv9Ybmxfm7DM=; b=MKJNf I6cTYrT6u8793fonDwuSJU8MiCzoWIAnJ6aAON5GgjV0U80295lclDvlvAlivGd3 f6Y5dIMJZOtrZGphbTzTkRbcwN0blyCr9rl6h4bFOcAccxoKO78dAbrmwdE4ri4/ MRs1DcWuXG6ko0MElGEicwVami6R2L4dZ49eGs= Received: (qmail 38367 invoked by alias); 1 Nov 2016 14:25:57 -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 37930 invoked by uid 89); 1 Nov 2016 14:25:54 -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-f180.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=Fp221fDZ2yOEBcQ37ZMxPjqIrTtBGBUTX4gHQstw27E=; b=QRVAeQL0ho47XayOI8xtXNvQvjFoPcneAsazU+RiOvKqnE93LwHG9j10pHe8dYp1IJ I+bsm7E1KPTc8gNYS3bTIlin+bMHuhNp/gJw73+/0LkNrSRGl+iVFpnuwbDYdiXPm3J7 7OvlE6zQwBkIPz/IY4LTwF88KIkHsbgLu74ABe1AHwM5CkoyKzOXWf+tZlZUu6l6d97k vY+llp6UrveAb+SRtohUosdTQLKZQre+M0sgyTwzkmq+k9pOlddDRW7OFR6nqV+W52dH QUUi4nFEvdZKdkglQ6dhh5xb4gPLEDd6MRTyPVp7nQosEmcfgK22v43DVYEQ16O4rX/Z xhBg== X-Gm-Message-State: ABUngvfB6IBa25N3ybg42i5NpA7u/0Yk0BwbGQAvVZ0+XyEEwFLXwrSpZE6WzFqhkVz9HdGk X-Received: by 10.159.33.193 with SMTP id 59mr26785451uac.28.1478010345979; Tue, 01 Nov 2016 07:25:45 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 13/15] Use shmdt syscall for linux implementation Date: Tue, 1 Nov 2016 12:25:21 -0200 Message-Id: <1478010323-13076-14-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 shmdt syscall if it is defined by kernel headers. hecked on x86_64, i686, powerpc64le, aarch64, and armhf. * sysdeps/unix/sysv/linux/shmdt.c (shmdt): Use shmdt syscall if it is defined. --- ChangeLog | 3 +++ sysdeps/unix/sysv/linux/shmdt.c | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/sysdeps/unix/sysv/linux/shmdt.c b/sysdeps/unix/sysv/linux/shmdt.c index 7224d6f..da5a881 100644 --- a/sysdeps/unix/sysv/linux/shmdt.c +++ b/sysdeps/unix/sysv/linux/shmdt.c @@ -16,12 +16,10 @@ License along with the GNU C Library; if not, see . */ -#include -#include +#include #include - #include -#include +#include /* Detach shared memory segment starting at address specified by SHMADDR from the caller's data segment. */ @@ -29,5 +27,9 @@ int shmdt (const void *shmaddr) { - return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); +#ifdef __NR_shmdt + return INLINE_SYSCALL_CALL (shmdt, 0, 0, 0, shmaddr); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr); +#endif }