From patchwork Wed May 14 18:09:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 914 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx23.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 4382C360098 for ; Wed, 14 May 2014 11:09:32 -0700 (PDT) Received: by homiemail-mx23.g.dreamhost.com (Postfix, from userid 14307373) id DAD2E63BCD25B; Wed, 14 May 2014 11:09:31 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx23.g.dreamhost.com 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 homiemail-mx23.g.dreamhost.com (Postfix) with ESMTPS id BC35663BCD2B5 for ; Wed, 14 May 2014 11:09:31 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; q= dns; s=default; b=RVirwuhpTk1zWU78BD1wT0TWpd6XHNHeGEjyxeKW4LkkBf ZJZLhglRhJb5RUktACOM+huXgHENoxd+QaNMhofEARd3+DILO93oQ4CleaFMUXxJ 0odekxzme6IdiTEiRtz49oeZcVuIyEgKEe682LRlbEAz1NF3bkimIl+EaSEkU= 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:mime-version:content-type :content-transfer-encoding:from:to:subject:message-id:date; s= default; bh=Jk9aaKEHQ3AfCMtSPXfTef6Qhnc=; b=AdlkRnxfD3TT2+7Da3wJ w4H5tRTqdOPrp7c73R8753gwuhfu+SMBXScj43fg2H3SR12CB42uSO5lME39cWhv r3UwA90eZIizcmbMuDsJlGS8/GGjAIN75oUHjohukLYZk98M/WRSS3kqm/6NlXZc c7qKt3Mko9nwqoChBVJL2XU= Received: (qmail 14436 invoked by alias); 14 May 2014 18:09:29 -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 14417 invoked by uid 89); 14 May 2014 18:09:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [COMMITTED PATCH] Consolidate not-cancel.h files. Message-Id: <20140514180923.D0EBB2C39C7@topped-with-meat.com> Date: Wed, 14 May 2014 11:09:23 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=HrjlRSjS c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=nnRvCL6w0zwA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=20KFwNOVAAAA:8 a=mDV3o1hIAAAA:8 a=9AzMRrQhAAAA:8 a=hXjDoY70L2T6ff1UkgoA:9 a=CjuIK1q_8ugA:10 a=jEp0ucaQiEUA:10 a=SxxB86fLhQ4A:10 X-DH-Original-To: glibc@patchwork.siddhesh.in There are in fact only two versions of not-cancel.h actually in use: the sysdeps/generic one for non-Linux, and the NPTL one living in nptl/sysdeps/unix/sysv/linux/i386/. The diff looks nontrivial only because moving nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h verbatim to sysdeps/unix/sysv/linux/ clobbered the unused file that was there before. Verified on x86_64-linux-gnu and i686-linux-gnu that no libc.so or libpthread.so code changes. It should be obviously so for other machines too. Thanks, Roland * nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h: Moved ... * sysdeps/unix/sysv/linux/not-cancel.h: ... here. * nptl/sysdeps/unix/sysv/linux/sparc/not-cancel.h: File removed. * nptl/sysdeps/unix/sysv/linux/sh/not-cancel.h: File removed. * nptl/sysdeps/unix/sysv/linux/powerpc/not-cancel.h: File removed. * nptl/sysdeps/unix/sysv/linux/x86_64/not-cancel.h: File removed. * nptl/sysdeps/unix/sysv/linux/s390/not-cancel.h: File removed. * sysdeps/unix/sysv/linux/generic/not-cancel.h: File removed. * sysdeps/unix/sysv/linux/generic/nptl/not-cancel.h: File removed. * sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h: File removed. --- a/nptl/sysdeps/unix/sysv/linux/i386/not-cancel.h +++ /dev/null @@ -1,104 +0,0 @@ -/* Uncancelable versions of cancelable interfaces. Linux/NPTL version. - Copyright (C) 2003-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 2003. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#include - -#if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt -extern int __open_nocancel (const char *, int, ...) attribute_hidden; -extern int __close_nocancel (int) attribute_hidden; -extern int __read_nocancel (int, void *, size_t) attribute_hidden; -extern int __write_nocancel (int, const void *, size_t) attribute_hidden; -extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden; -extern int __openat_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; -extern int __openat64_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; -#else -# define __open_nocancel(name, ...) __open (name, __VA_ARGS__) -# define __close_nocancel(fd) __close (fd) -# define __read_nocancel(fd, buf, len) __read (fd, buf, len) -# define __write_nocancel(fd, buf, len) __write (fd, buf, len) -# define __waitpid_nocancel(pid, stat_loc, options) \ - __waitpid (pid, stat_loc, options) -# define __openat_nocancel(fd, fname, oflag, mode) \ - openat (fd, fname, oflag, mode) -# define __openat64_nocancel(fd, fname, oflag, mode) \ - openat64 (fd, fname, oflag, mode) -#endif - -/* Uncancelable open. */ -#define open_not_cancel(name, flags, mode) \ - __open_nocancel (name, flags, mode) -#define open_not_cancel_2(name, flags) \ - __open_nocancel (name, flags) - -/* Uncancelable openat. */ -#define openat_not_cancel(fd, fname, oflag, mode) \ - __openat_nocancel (fd, fname, oflag, mode) -#define openat_not_cancel_3(fd, fname, oflag) \ - __openat_nocancel (fd, fname, oflag, 0) -#define openat64_not_cancel(fd, fname, oflag, mode) \ - __openat64_nocancel (fd, fname, oflag, mode) -#define openat64_not_cancel_3(fd, fname, oflag) \ - __openat64_nocancel (fd, fname, oflag, 0) - -/* Uncancelable close. */ -#define close_not_cancel(fd) \ - __close_nocancel (fd) -#define close_not_cancel_no_status(fd) \ - (void) ({ INTERNAL_SYSCALL_DECL (err); \ - INTERNAL_SYSCALL (close, err, 1, (fd)); }) - -/* Uncancelable read. */ -#define read_not_cancel(fd, buf, n) \ - __read_nocancel (fd, buf, n) - -/* Uncancelable write. */ -#define write_not_cancel(fd, buf, n) \ - __write_nocancel (fd, buf, n) - -/* Uncancelable writev. */ -#define writev_not_cancel_no_status(fd, iov, n) \ - (void) ({ INTERNAL_SYSCALL_DECL (err); \ - INTERNAL_SYSCALL (writev, err, 3, (fd), (iov), (n)); }) - -/* Uncancelable fcntl. */ -#define fcntl_not_cancel(fd, cmd, val) \ - __fcntl_nocancel (fd, cmd, val) - -/* Uncancelable waitpid. */ -#ifdef __NR_waitpid -# define waitpid_not_cancel(pid, stat_loc, options) \ - __waitpid_nocancel (pid, stat_loc, options) -#else -# define waitpid_not_cancel(pid, stat_loc, options) \ - INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL) -#endif - -/* Uncancelable pause. */ -#define pause_not_cancel() \ - __pause_nocancel () - -/* Uncancelable nanosleep. */ -#define nanosleep_not_cancel(requested_time, remaining) \ - __nanosleep_nocancel (requested_time, remaining) - -/* Uncancelable sigsuspend. */ -#define sigsuspend_not_cancel(set) \ - __sigsuspend_nocancel (set) --- a/nptl/sysdeps/unix/sysv/linux/powerpc/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" --- a/nptl/sysdeps/unix/sysv/linux/s390/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" --- a/nptl/sysdeps/unix/sysv/linux/sh/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" --- a/nptl/sysdeps/unix/sysv/linux/sparc/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" --- a/nptl/sysdeps/unix/sysv/linux/x86_64/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i386/not-cancel.h" --- a/sysdeps/unix/sysv/linux/generic/not-cancel.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Uncancelable versions of cancelable interfaces. Linux asm-generic version. - Copyright (C) 2012-2014 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Chris Metcalf , 2012. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#ifndef _LINUX_GENERIC_NOT_CANCEL_H -#define _LINUX_GENERIC_NOT_CANCEL_H - -#include -#include - -/* Uncancelable open with openat. */ -#undef open_not_cancel -#define open_not_cancel(name, flags, mode) \ - INLINE_SYSCALL (openat, 4, AT_FDCWD, (const char *) (name), (flags), (mode)) -#undef open_not_cancel_2 -#define open_not_cancel_2(name, flags) \ - INLINE_SYSCALL (openat, 3, AT_FDCWD, (const char *) (name), (flags)) - -#endif --- a/sysdeps/unix/sysv/linux/generic/nptl/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include --- a/sysdeps/unix/sysv/linux/m68k/nptl/not-cancel.h +++ /dev/null @@ -1 +0,0 @@ -#include --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -1,4 +1,4 @@ -/* Uncancelable versions of cancelable interfaces. Linux version. +/* Uncancelable versions of cancelable interfaces. Linux/NPTL version. Copyright (C) 2003-2014 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2003. @@ -17,28 +17,38 @@ License along with the GNU C Library; if not, see . */ -#include #include -/* Uncancelable open. */ -#define open_not_cancel(name, flags, mode) \ - INLINE_SYSCALL (open, 3, (const char *) (name), (flags), (mode)) -#define open_not_cancel_2(name, flags) \ - INLINE_SYSCALL (open, 2, (const char *) (name), (flags)) - -/* Uncancelable openat. */ #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt +extern int __open_nocancel (const char *, int, ...) attribute_hidden; +extern int __close_nocancel (int) attribute_hidden; +extern int __read_nocancel (int, void *, size_t) attribute_hidden; +extern int __write_nocancel (int, const void *, size_t) attribute_hidden; +extern pid_t __waitpid_nocancel (pid_t, int *, int) attribute_hidden; extern int __openat_nocancel (int fd, const char *fname, int oflag, - mode_t mode) attribute_hidden; -extern int __openat64_nocancel (int fd, const char *fname, int oflag, mode_t mode) attribute_hidden; +extern int __openat64_nocancel (int fd, const char *fname, int oflag, + mode_t mode) attribute_hidden; #else +# define __open_nocancel(name, ...) __open (name, __VA_ARGS__) +# define __close_nocancel(fd) __close (fd) +# define __read_nocancel(fd, buf, len) __read (fd, buf, len) +# define __write_nocancel(fd, buf, len) __write (fd, buf, len) +# define __waitpid_nocancel(pid, stat_loc, options) \ + __waitpid (pid, stat_loc, options) # define __openat_nocancel(fd, fname, oflag, mode) \ openat (fd, fname, oflag, mode) # define __openat64_nocancel(fd, fname, oflag, mode) \ openat64 (fd, fname, oflag, mode) #endif +/* Uncancelable open. */ +#define open_not_cancel(name, flags, mode) \ + __open_nocancel (name, flags, mode) +#define open_not_cancel_2(name, flags) \ + __open_nocancel (name, flags) + +/* Uncancelable openat. */ #define openat_not_cancel(fd, fname, oflag, mode) \ __openat_nocancel (fd, fname, oflag, mode) #define openat_not_cancel_3(fd, fname, oflag) \ @@ -50,18 +60,18 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag, /* Uncancelable close. */ #define close_not_cancel(fd) \ - INLINE_SYSCALL (close, 1, fd) + __close_nocancel (fd) #define close_not_cancel_no_status(fd) \ (void) ({ INTERNAL_SYSCALL_DECL (err); \ INTERNAL_SYSCALL (close, err, 1, (fd)); }) /* Uncancelable read. */ #define read_not_cancel(fd, buf, n) \ - INLINE_SYSCALL (read, 3, (fd), (buf), (n)) + __read_nocancel (fd, buf, n) /* Uncancelable write. */ #define write_not_cancel(fd, buf, n) \ - INLINE_SYSCALL (write, 3, (fd), (buf), (n)) + __write_nocancel (fd, buf, n) /* Uncancelable writev. */ #define writev_not_cancel_no_status(fd, iov, n) \ @@ -75,29 +85,19 @@ extern int __openat64_nocancel (int fd, const char *fname, int oflag, /* Uncancelable waitpid. */ #ifdef __NR_waitpid # define waitpid_not_cancel(pid, stat_loc, options) \ - INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options) + __waitpid_nocancel (pid, stat_loc, options) #else # define waitpid_not_cancel(pid, stat_loc, options) \ INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL) #endif /* Uncancelable pause. */ -#ifdef __NR_pause -# define pause_not_cancel() \ - INLINE_SYSCALL (pause, 0) -#else -# define pause_not_cancel() \ +#define pause_not_cancel() \ __pause_nocancel () -#endif /* Uncancelable nanosleep. */ -#ifdef __NR_nanosleep -# define nanosleep_not_cancel(requested_time, remaining) \ - INLINE_SYSCALL (nanosleep, 2, requested_time, remaining) -#else -# define nanosleep_not_cancel(requested_time, remaining) \ +#define nanosleep_not_cancel(requested_time, remaining) \ __nanosleep_nocancel (requested_time, remaining) -#endif /* Uncancelable sigsuspend. */ #define sigsuspend_not_cancel(set) \