From patchwork Wed Nov 2 19:26:51 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: 690559 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 3t8J7s2tkWz9t5m for ; Thu, 3 Nov 2016 06:29:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=fk5IUuqu; 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=Tz8xC8qPWbHbIkddD3cbXHLNu0GXxB8 hoDc73bQ1QdVnkjUQ9yqd2VrSMOdIqUHk9Z26hLCJmzuxxUxPzUpB01dszxLV1a1 LdGqzfiltjBzmQSP4bYkpdya24W+5LOG7JQykoaMCEZgpxDLbJWsA6fJu1+REStg TWmStBSY+jCg= 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=fbWXS9AKuoDCJ6DIKIuwvKTjlT8=; b=fk5IU uqutJfLhtMJ/nyawoTI1mDIRxudqxeZdpT+vtDnqbe58GIrWPgPJr4ZubJEVo5a0 /4gXnuO45/ok88nZpt1fprI+dGddHi0bSZef5dyVPMGIBhrfDXW5mMAF4J98kWLk MEV89MNaIId2Z0UniDwnfzSIX3FmFokSXF4K+0= Received: (qmail 65746 invoked by alias); 2 Nov 2016 19:27:28 -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 65527 invoked by uid 89); 2 Nov 2016 19:27:26 -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= X-HELO: mail-vk0-f51.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=PVCluU6n+3/ehaaED3cU+/PkgyF1moXipMHpOHeqIWg=; b=PIC+B8H5Am1lL48tlfkgdebFovt9KuBkGjzc8O3PgzAqvGWOutlXS2keOvzHBoHSoZ +9f41+56HIafZvxv2zv7NUsz9Twb9CHUkHWrMwQt9TzCt5Z+ZoQbQpX8aJoZAjsvRAUf 513rzoAchj3sW76dmsEsJJUv+5CHi4UnjA51/T2kMWSRhvZ3A6RNh3UCbqklfvarDmtY 1ypJdWqU3bEDKLcLyeU6c83UUe3tviO5nd+rUIBgFWinoaR+/xzULn5HBU7KdJfnanXg 7wi45X48izoYYSscfsaytbcNTg4LV2aH2NAygWToLJu2dQQ87s4WPrvOit+z+xN/mkLk 1NuA== X-Gm-Message-State: ABUngvca8b9CshvfIyuqw/ob1L+TLEHWS9RzzBl9GlIsfvxJTSfYVpz+ZeFP3NadJ7PVn5do X-Received: by 10.31.107.135 with SMTP id k7mr4164342vki.119.1478114837861; Wed, 02 Nov 2016 12:27:17 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2 14/16] Use shmdt syscall for linux implementation Date: Wed, 2 Nov 2016 17:26:51 -0200 Message-Id: <1478114813-3526-15-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> 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 shmdt syscall if it is supported by kernel features. 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(-) diff --git a/sysdeps/unix/sysv/linux/shmdt.c b/sysdeps/unix/sysv/linux/shmdt.c index 7224d6f..2f5b316 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 __ASSUME_SYSVIPC_SYSCALL + return INLINE_SYSCALL_CALL (shmdt, 0, 0, 0, shmaddr); +#else + return INLINE_SYSCALL_CALL (ipc, IPCOP_shmdt, 0, 0, 0, shmaddr); +#endif }