summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/open64.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux/open64.c')
-rw-r--r--sysdeps/unix/sysv/linux/open64.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/open64.c b/sysdeps/unix/sysv/linux/open64.c
index 01cbbb4f03..55ef658800 100644
--- a/sysdeps/unix/sysv/linux/open64.c
+++ b/sysdeps/unix/sysv/linux/open64.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
+/* Linux open syscall implementation, LFS.
+ Copyright (C) 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,12 +16,20 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <stdarg.h>
-#include <stdio.h>
+
#include <sysdep-cancel.h>
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+# define EXTRA_OPEN_FLAGS 0
+#else
+# define EXTRA_OPEN_FLAGS O_LARGEFILE
+#endif
+
/* Open FILE with access OFLAG. If O_CREAT or O_TMPFILE is in OFLAG,
a third argument is the file protection. */
int
@@ -36,8 +45,17 @@ __libc_open64 (const char *file, int oflag, ...)
va_end (arg);
}
- return SYSCALL_CANCEL (open, file, oflag | O_LARGEFILE, mode);
+ return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | EXTRA_OPEN_FLAGS,
+ mode);
}
-weak_alias (__libc_open64, __open64)
+
+strong_alias (__libc_open64, __open64)
libc_hidden_weak (__open64)
weak_alias (__libc_open64, open64)
+
+#ifdef __OFF_T_MATCHES_OFF64_T
+strong_alias (__libc_open64, __libc_open)
+strong_alias (__libc_open64, __open)
+libc_hidden_weak (__open)
+weak_alias (__libc_open64, open)
+#endif