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: 17119 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 }