public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Rework not-cancel function prototypes Date: Tue, 4 Oct 2022 12:56:08 +0000 (GMT) [thread overview] Message-ID: <20221004125608.729823858404@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3f7cb7b03a88be4479e3fcebaee0a51468586be8 commit 3f7cb7b03a88be4479e3fcebaee0a51468586be8 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> 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 | 54 ++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index f4437ff6ad..0715d87c7d 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -520,6 +520,8 @@ for linking") __hidden_proto (name, , __GI_##name, ##attrs) # define hidden_proto_alias(name, alias, attrs...) \ __hidden_proto_alias (name, , alias, ##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...) \ @@ -527,6 +529,9 @@ for linking") __hidden_proto_hiddenattr (attrs); # define __hidden_proto_alias(name, thread, internal, attrs...) \ extern thread __typeof (name) 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) @@ -602,6 +607,10 @@ for linking") # define hidden_proto_alias(name, alias, 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 93615de681..f2d3594269 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -28,29 +28,35 @@ #include <sys/wait.h> #include <time.h> -/* 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. */ @@ -83,16 +89,4 @@ __poll_infinity_nocancel (struct pollfd *fds, nfds_t nfds) /* 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 */
next reply other threads:[~2022-10-04 12:56 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-04 12:56 Adhemerval Zanella [this message] -- strict thread matches above, loose matches on Subject: below -- 2022-06-09 21:18 Adhemerval Zanella 2022-06-09 13:14 Adhemerval Zanella 2022-06-03 14:03 Adhemerval Zanella 2022-05-13 14:17 Adhemerval Zanella 2022-05-12 19:31 Adhemerval Zanella 2022-05-10 18:21 Adhemerval Zanella 2022-04-29 14:01 Adhemerval Zanella 2022-04-04 12:52 Adhemerval Zanella 2022-03-31 19:04 Adhemerval Zanella 2022-03-29 20:27 Adhemerval Zanella 2022-03-16 17:59 Adhemerval Zanella 2022-03-15 18:37 Adhemerval Zanella 2022-03-11 17:21 Adhemerval Zanella 2022-03-10 19:20 Adhemerval Zanella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221004125608.729823858404@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).