about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/open.c')
-rw-r--r--sysdeps/unix/sysv/linux/open.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/open.c b/sysdeps/unix/sysv/linux/open.c
index b3912d5554..3ef0e53e4c 100644
--- a/sysdeps/unix/sysv/linux/open.c
+++ b/sysdeps/unix/sysv/linux/open.c
@@ -22,6 +22,7 @@
 #include <stdarg.h>
 
 #include <sysdep-cancel.h>
+#include <not-cancel.h>
 
 #ifndef __OFF_T_MATCHES_OFF64_T
 
@@ -48,4 +49,24 @@ weak_alias (__libc_open, __open)
 libc_hidden_weak (__open)
 weak_alias (__libc_open, open)
 
+# if !IS_IN (rtld)
+int
+__open_nocancel (const char *file, int oflag, ...)
+{
+  int mode = 0;
+
+  if (__OPEN_NEEDS_MODE (oflag))
+    {
+      va_list arg;
+      va_start (arg, oflag);
+      mode = va_arg (arg, int);
+      va_end (arg);
+    }
+
+  return INLINE_SYSCALL_CALL (openat, AT_FDCWD, file, oflag, mode);
+}
+# else
+strong_alias (__libc_open, __open_nocancel)
+# endif
+libc_hidden_def (__open_nocancel)
 #endif