about summary refs log tree commit diff homepage
path: root/runtime/POSIX/fd_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/POSIX/fd_64.c')
-rw-r--r--runtime/POSIX/fd_64.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/runtime/POSIX/fd_64.c b/runtime/POSIX/fd_64.c
index 268579c0..21a986aa 100644
--- a/runtime/POSIX/fd_64.c
+++ b/runtime/POSIX/fd_64.c
@@ -17,7 +17,7 @@
 
 
 #include "klee/Config/Version.h"
-#if defined(ENV64) || (LLVM_VERSION_CODE < LLVM_VERSION(3, 3))
+#if defined(ENV64) || (LLVM_VERSION_CODE < LLVM_VERSION(3, 2))
 #define _LARGEFILE64_SOURCE
 #define _FILE_OFFSET_BITS 64
 #include "fd.h"
@@ -57,6 +57,20 @@ int open(const char *pathname, int flags, ...) {
   return __fd_open(pathname, flags, mode);
 }
 
+int openat(int fd, const char *pathname, int flags, ...) {
+  mode_t mode = 0;
+  
+  if (flags & O_CREAT) {
+    /* get mode */
+    va_list ap;
+    va_start(ap, flags);
+    mode = va_arg(ap, mode_t);
+    va_end(ap);
+  }
+
+  return __fd_openat(fd, pathname, flags, mode);
+}
+
 off64_t lseek(int fd, off64_t offset, int whence) {
   return __fd_lseek(fd, offset, whence);
 }