mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Consolidate non cancellable openat call
This patch consolidates all the non cancellable openat{64} calls to use
the __openat{64}_nocancel identifier. For non cancellable targets it will
be just a macro to call the default respective symbol while on Linux
will be a internal one.
Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu.
* sysdeps/generic/not-cancel.h (openat_not_cancel): Remove macro.
(openat_not_cancel_3): Likewise.
(openat64_not_cancel_3): Likewise).
(openat_not_cancel_3): Likewise).
* sysdeps/unix/sysv/linux/not-cancel.h (openat_not_cancel): Remove
macro.
(openat_not_cancel_3): Likewise.
(openat64_not_cancel): Likewise.
(openat64_not_cancel_3): Likewise.
* sysdeps/unix/sysv/linux/openat.c (__openat_nocancel): New function.
* sysdeps/unix/sysv/linux/openat64.c (__openat64_nocancel): Likewise.
* io/ftw.c (open_dir_stream): Replace openat{64}_not_cancel{_3} with
__open{64}_nocancel.
* sysdeps/mach/hurd/opendir.c (__opendirat): Likewise.
* sysdeps/posix/getcwd.c (__getcwd): Likewise.
* sysdeps/posix/opendir.c (__opendirat): Likewise.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <sysdep-cancel.h>
|
||||
#include <not-cancel.h>
|
||||
|
||||
#ifndef __OFF_T_MATCHES_OFF64_T
|
||||
|
||||
@@ -43,4 +44,23 @@ weak_alias (__libc_openat, __openat)
|
||||
libc_hidden_weak (__openat)
|
||||
weak_alias (__libc_openat, openat)
|
||||
|
||||
# if !IS_IN (rtld)
|
||||
int
|
||||
__openat_nocancel (int fd, const char *file, int oflag, ...)
|
||||
{
|
||||
mode_t mode = 0;
|
||||
if (__OPEN_NEEDS_MODE (oflag))
|
||||
{
|
||||
va_list arg;
|
||||
va_start (arg, oflag);
|
||||
mode = va_arg (arg, mode_t);
|
||||
va_end (arg);
|
||||
}
|
||||
|
||||
return INLINE_SYSCALL_CALL (openat, fd, file, oflag, mode);
|
||||
}
|
||||
# else
|
||||
strong_alias (__libc_openat, __openat_nocancel)
|
||||
# endif
|
||||
libc_hidden_weak (__openat_nocancel)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user