Apply asm redirection in not-cancel before first use

It is avoid a build failure on clang where it can not redeclare function
attribute after its first use.

Reviewed-by: Fangrui Song <maskray@google.com>
This commit is contained in:
Adhemerval Zanella 2022-10-24 16:12:15 -03:00
parent d08dec4ea7
commit d227fd53cb

View File

@ -52,6 +52,21 @@ __typeof (__write) __write_nocancel;
/* Uncancelable close. */
__typeof (__close) __close_nocancel;
/* 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
/* Non cancellable close syscall that does not also set errno in case of
failure. */
static inline void
@ -80,19 +95,4 @@ __poll_infinity_nocancel (struct pollfd *fds, nfds_t nfds)
return INLINE_SYSCALL_CALL (ppoll, fds, nfds, NULL, NULL, 0);
}
/* 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 */