[PATCH v3 44/48] open64: Use openat if arch does not have the open syscall
Markos Chandras
markos.chandras at gmail.com
Wed Jan 23 11:42:08 UTC 2013
From: Markos Chandras <markos.chandras at imgtec.com>
Signed-off-by: Markos Chandras <markos.chandras at imgtec.com>
---
libc/sysdeps/linux/common/open64.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index bbb12cd..8a4ef29 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -21,8 +21,11 @@ int open64(const char *file, int oflag, ...)
mode = va_arg (arg, mode_t);
va_end (arg);
}
-
+#if defined(__NR_openat) && !defined(__NR_open)
+ return openat(AT_FDCWD, file, oflag | O_LARGEFILE, mode);
+#else
return open(file, oflag | O_LARGEFILE, mode);
+#endif
}
lt_strong_alias(open64)
lt_libc_hidden(open64)
--
1.8.1.1
More information about the uClibc
mailing list