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, 10 Mar 2022 19:20:10 +0000 (GMT)	[thread overview]
Message-ID: <20220310192010.B3712385841F@sourceware.org> (raw)

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

commit ad643fff57db9e1170a2fc09d95eece07037ae72
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 | 36 +++++++++++++++---------------------
 2 files changed, 24 insertions(+), 21 deletions(-)

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 662bd118b1..f4c1312ba5 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -532,11 +532,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)
@@ -604,6 +609,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 6c0491bde3..5887cb4106 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -27,20 +27,26 @@
 #include <sys/wait.h>
 #include <time.h>
 
+#if IS_IN (libc) || IS_IN (rtld)
 /* Non cacellable openat syscall (LFS version).  */
-__typeof (openat64) __openat64_nocancel;
-
+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 (openat64) __openat64_nocancel;
+__typeof (read) __read_nocancel;
+__typeof (pread64) __pread64_nocancel;
+__typeof (write) __write_nocancel;
+__typeof (close) __close_nocancel;
+#endif
 
 #define __open64_nocancel(args...) \
   __openat64_nocancel (AT_FDCWD, args)
@@ -61,16 +67,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 (__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-03-10 19:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-10 19:20 Adhemerval Zanella [this message]
2022-03-11 17:21 Adhemerval Zanella
2022-03-15 18:37 Adhemerval Zanella
2022-03-16 17:59 Adhemerval Zanella
2022-03-29 20:27 Adhemerval Zanella
2022-03-31 19:04 Adhemerval Zanella
2022-04-04 12:52 Adhemerval Zanella
2022-04-29 14:01 Adhemerval Zanella
2022-05-10 18:21 Adhemerval Zanella
2022-05-12 19:31 Adhemerval Zanella
2022-05-13 14:17 Adhemerval Zanella
2022-06-03 14:03 Adhemerval Zanella
2022-06-09 13:14 Adhemerval Zanella
2022-06-09 21:18 Adhemerval Zanella
2022-10-04 12:56 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=20220310192010.B3712385841F@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).