implement futimens and utimensat
authorRich Felker <dalias@aerifal.cx>
Sun, 27 Feb 2011 08:48:57 +0000 (03:48 -0500)
committerRich Felker <dalias@aerifal.cx>
Sun, 27 Feb 2011 08:48:57 +0000 (03:48 -0500)
include/sys/stat.h
src/stat/futimens.c [new file with mode: 0644]
src/stat/utimensat.c [new file with mode: 0644]

index 25c199f..5363a9a 100644 (file)
@@ -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
diff --git a/src/stat/futimens.c b/src/stat/futimens.c
new file mode 100644 (file)
index 0000000..360225b
--- /dev/null
@@ -0,0 +1,6 @@
+#include <sys/stat.h>
+
+int futimens(int fd, const struct timespec times[2])
+{
+       return utimensat(fd, 0, times, 0);
+}
diff --git a/src/stat/utimensat.c b/src/stat/utimensat.c
new file mode 100644 (file)
index 0000000..b9b02ad
--- /dev/null
@@ -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);
+}