OSDN Git Service

open64: Use openat if arch does not have the open syscall
authorMarkos Chandras <markos.chandras@imgtec.com>
Fri, 12 Oct 2012 10:28:35 +0000 (11:28 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 20 Feb 2013 12:45:13 +0000 (13:45 +0100)
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
libc/sysdeps/linux/common/open64.c

index bbb12cd..23a777b 100644 (file)
@@ -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)