Browse Source

implement futimens and utimensat

Rich Felker 14 years ago
parent
commit
eda8e9da76
3 changed files with 16 additions and 0 deletions
  1. 3 0
      include/sys/stat.h
  2. 6 0
      src/stat/futimens.c
  3. 7 0
      src/stat/utimensat.c

+ 3 - 0
include/sys/stat.h

@@ -86,6 +86,9 @@ int mkdirat(int, const char *, mode_t);
 int mknodat(int, const char *, mode_t, dev_t);
 int mkfifoat(int, const char *, mode_t);
 
+int futimens(int, const struct timespec [2]);
+int utimensat(int, const char *, const struct timespec [2], int);
+
 #ifdef _BSD_SOURCE
 int lchmod(const char *, mode_t);
 #endif

+ 6 - 0
src/stat/futimens.c

@@ -0,0 +1,6 @@
+#include <sys/stat.h>
+
+int futimens(int fd, const struct timespec times[2])
+{
+	return utimensat(fd, 0, times, 0);
+}

+ 7 - 0
src/stat/utimensat.c

@@ -0,0 +1,7 @@
+#include <sys/stat.h>
+#include "syscall.h"
+
+int utimensat(int fd, const char *path, const struct timespec times[2], int flags)
+{
+	return syscall4(__NR_utimensat, fd, (long)path, (long)times, flags);
+}