From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 54B1938344E3; Thu, 9 Jun 2022 13:14:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54B1938344E3 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Rework not-cancel function prototypes X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: d4541205284af9b98ca5980ddddb753d3bd30d22 X-Git-Newrev: 851b5c6183238c674bf2803e247dc86a3f39f104 Message-Id: <20220609131434.54B1938344E3@sourceware.org> Date: Thu, 9 Jun 2022 13:14:34 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 13:14:34 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=851b5c6183238c674bf2803e247dc86a3f39f104 commit 851b5c6183238c674bf2803e247dc86a3f39f104 Author: Adhemerval Zanella Date: Tue Mar 8 16:41:14 2022 -0300 Rework not-cancel function prototypes By adding a new hidden_proto2 macro. Diff: --- include/libc-symbols.h | 9 ++++++ sysdeps/unix/sysv/linux/not-cancel.h | 57 +++++++++++++++--------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 4bb3d8c7ba..ac9a302cb6 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -534,11 +534,16 @@ for linking") __attribute__ ((visibility ("hidden"), ##attrs)) # define hidden_proto(name, attrs...) \ __hidden_proto (name, , __GI_##name, ##attrs) +# define hidden_proto2(type, name, attrs...) \ + __hidden_proto2 (type, name, , __GI_##name, ##attrs) # define hidden_tls_proto(name, attrs...) \ __hidden_proto (name, __thread, __GI_##name, ##attrs) # define __hidden_proto(name, thread, internal, attrs...) \ extern thread __typeof (name) name __asm__ (__hidden_asmname (#internal)) \ __hidden_proto_hiddenattr (attrs); +# define __hidden_proto2(type, name, thread, internal, attrs...) \ + extern thread __typeof (type) name __asm__ (__hidden_asmname (#internal)) \ + __hidden_proto_hiddenattr (attrs); # define __hidden_asmname(name) \ __hidden_asmname1 (__USER_LABEL_PREFIX__, name) # define __hidden_asmname1(prefix, name) __hidden_asmname2(prefix, name) @@ -606,6 +611,10 @@ for linking") # define hidden_proto(name, attrs...) # define hidden_tls_proto(name, attrs...) # endif +# define __hidden_proto2(type, name, thread, attrs...) \ + extern thread __typeof (type) name __attribute__ ((visibility ("hidden"), ##attrs)); +# define hidden_proto2(type, name, attrs...) \ + __hidden_proto2(type, name, , attrs) # else # define HIDDEN_JUMPTARGET(name) JUMPTARGET(name) # endif /* Not __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h index 75b9e0ee1e..da2f2463b6 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -27,29 +27,35 @@ #include #include -/* Non cancellable open syscall. */ -__typeof (open) __open_nocancel; - -/* Non cancellable open syscall (LFS version). */ -__typeof (open64) __open64_nocancel; - -/* Non cancellable openat syscall. */ -__typeof (openat) __openat_nocancel; - +#if IS_IN (libc) || IS_IN (rtld) +/* Non cacellable open syscall (LFS version). */ +hidden_proto2 (open, __open_nocancel) +/* Non cacellable open syscall (LFS version). */ +hidden_proto2 (open64, __open64_nocancel) /* Non cacellable openat syscall (LFS version). */ -__typeof (openat64) __openat64_nocancel; - +hidden_proto2 (openat, __openat_nocancel) +/* Non cacellable openat syscall (LFS version). */ +hidden_proto2 (openat64, __openat64_nocancel) /* Non cancellable read syscall. */ -__typeof (__read) __read_nocancel; - +hidden_proto2 (read, __read_nocancel) /* Non cancellable pread syscall (LFS version). */ -__typeof (__pread64) __pread64_nocancel; - +hidden_proto2 (pread64, __pread64_nocancel) /* Uncancelable write. */ -__typeof (__write) __write_nocancel; - +hidden_proto2 (write, __write_nocancel) /* Uncancelable close. */ -__typeof (__close) __close_nocancel; +hidden_proto2 (close, __close_nocancel) +/* Uncancelable fcntl. */ +hidden_proto2 (fcntl64, __fcntl64_nocancel) +#else +__typeof (open) __open_nocancel; +__typeof (open64) __open64_nocancel; +__typeof (openat) __openat_nocancel; +__typeof (openat64) __openat64_nocancel; +__typeof (read) __read_nocancel; +__typeof (pread64) __pread64_nocancel; +__typeof (write) __write_nocancel; +__typeof (close) __close_nocancel; +#endif /* Non cancellable close syscall that does not also set errno in case of failure. */ @@ -67,19 +73,4 @@ __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt) INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt); } -/* Uncancelable fcntl. */ -__typeof (__fcntl) __fcntl64_nocancel; - -#if IS_IN (libc) || IS_IN (rtld) -hidden_proto (__open_nocancel) -hidden_proto (__open64_nocancel) -hidden_proto (__openat_nocancel) -hidden_proto (__openat64_nocancel) -hidden_proto (__read_nocancel) -hidden_proto (__pread64_nocancel) -hidden_proto (__write_nocancel) -hidden_proto (__close_nocancel) -hidden_proto (__fcntl64_nocancel) -#endif - #endif /* NOT_CANCEL_H */