summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/fcntl.c')
-rw-r--r--sysdeps/unix/sysv/linux/fcntl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/sysdeps/unix/sysv/linux/fcntl.c b/sysdeps/unix/sysv/linux/fcntl.c
index 76e846c6ac..cda6be712d 100644
--- a/sysdeps/unix/sysv/linux/fcntl.c
+++ b/sysdeps/unix/sysv/linux/fcntl.c
@@ -19,6 +19,7 @@
#include <stdarg.h>
#include <errno.h>
#include <sysdep-cancel.h>
+#include <not-cancel.h>
#ifndef __NR_fcntl64
# define __NR_fcntl64 __NR_fcntl
@@ -46,9 +47,8 @@ fcntl_common (int fd, int cmd, void *arg)
return INLINE_SYSCALL_CALL (fcntl64, fd, cmd, (void *) arg);
}
-#ifndef NO_CANCELLATION
int
-__fcntl_nocancel (int fd, int cmd, ...)
+__libc_fcntl (int fd, int cmd, ...)
{
va_list ap;
void *arg;
@@ -57,12 +57,18 @@ __fcntl_nocancel (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
+ cmd = FCNTL_ADJUST_CMD (cmd);
+
+ if (cmd == F_SETLKW || cmd == F_SETLKW64)
+ return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);
+
return fcntl_common (fd, cmd, arg);
}
-#endif
+libc_hidden_def (__libc_fcntl)
+#if !IS_IN (rtld)
int
-__libc_fcntl (int fd, int cmd, ...)
+__fcntl_nocancel (int fd, int cmd, ...)
{
va_list ap;
void *arg;
@@ -71,14 +77,12 @@ __libc_fcntl (int fd, int cmd, ...)
arg = va_arg (ap, void *);
va_end (ap);
- cmd = FCNTL_ADJUST_CMD (cmd);
-
- if (cmd == F_SETLKW || cmd == F_SETLKW64)
- return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);
-
return fcntl_common (fd, cmd, arg);
}
-libc_hidden_def (__libc_fcntl)
+#else
+strong_alias (__libc_fcntl, __fcntl_nocancel)
+#endif
+libc_hidden_def (__fcntl_nocancel)
weak_alias (__libc_fcntl, __fcntl)
libc_hidden_weak (__fcntl)