about summary refs log tree commit diff homepage
path: root/runtime/POSIX/fd_32.c
diff options
context:
space:
mode:
authorCristian Cadar <c.cadar@imperial.ac.uk>2013-09-25 07:36:44 -0700
committerCristian Cadar <c.cadar@imperial.ac.uk>2013-09-25 07:36:44 -0700
commit43138101d048394690a90fd9f5a6fb0df916161c (patch)
tree70e9d4a75804cc2ef12bda03fd029c013462e123 /runtime/POSIX/fd_32.c
parent1510c721187f1e838d30fca376af2ab5af90ee6c (diff)
parent90601a60fb6a0f22337c46680f150ec04ad3c6cb (diff)
downloadklee-43138101d048394690a90fd9f5a6fb0df916161c.tar.gz
Merge pull request #25 from paulmar/master
Added some of the common *at functions & others to the model.  Obey --max-forks in switch statements.
Diffstat (limited to 'runtime/POSIX/fd_32.c')
-rw-r--r--runtime/POSIX/fd_32.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/runtime/POSIX/fd_32.c b/runtime/POSIX/fd_32.c
index 1e96de37..13195fbf 100644
--- a/runtime/POSIX/fd_32.c
+++ b/runtime/POSIX/fd_32.c
@@ -53,6 +53,12 @@ static void __stat64_to_stat(struct stat64 *a, struct stat *b) {
   b->st_ctime = a->st_ctime;
   b->st_blksize = a->st_blksize;
   b->st_blocks = a->st_blocks;
+#ifdef _BSD_SOURCE
+  b->st_atim.tv_nsec = a->st_atim.tv_nsec;
+  b->st_mtim.tv_nsec = a->st_mtim.tv_nsec;
+  b->st_ctim.tv_nsec = a->st_ctim.tv_nsec;
+#endif
+
 }
 
 /***/
@@ -71,6 +77,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);
+}
+
 off_t lseek(int fd, off_t off, int whence) {
   return (off_t) __fd_lseek(fd, off, whence);
 }