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: Thu,  9 Jun 2022 13:14:34 +0000 (GMT)	[thread overview]
Message-ID: <20220609131434.54B1938344E3@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=851b5c6183238c674bf2803e247dc86a3f39f104

commit 851b5c6183238c674bf2803e247dc86a3f39f104
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 | 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 <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.  */
@@ -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  */


             reply	other threads:[~2022-06-09 13:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 13:14 Adhemerval Zanella [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-10-04 12:56 Adhemerval Zanella
2022-06-09 21:18 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=20220609131434.54B1938344E3@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: link
Be 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).