about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-02-27 03:48:57 -0500
committerRich Felker <dalias@aerifal.cx>2011-02-27 03:48:57 -0500
commiteda8e9da763df3fd25fc6c78602d7c79296eae6b (patch)
treede92e9710de4cca70c106dc51b49a438ebaa1cb9
parentb1b465c4382d6956e2973b70d644b0c20f530430 (diff)
downloadmusl-eda8e9da763df3fd25fc6c78602d7c79296eae6b.tar.gz
musl-eda8e9da763df3fd25fc6c78602d7c79296eae6b.tar.xz
musl-eda8e9da763df3fd25fc6c78602d7c79296eae6b.zip
implement futimens and utimensat
-rw-r--r--include/sys/stat.h3
-rw-r--r--src/stat/futimens.c6
-rw-r--r--src/stat/utimensat.c7
3 files changed, 16 insertions, 0 deletions
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 25c199f9..5363a9a3 100644
--- a/include/sys/stat.h
+++ b/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
diff --git a/src/stat/futimens.c b/src/stat/futimens.c
new file mode 100644
index 00000000..360225b8
--- /dev/null
+++ b/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);
+}
diff --git a/src/stat/utimensat.c b/src/stat/utimensat.c
new file mode 100644
index 00000000..b9b02adf
--- /dev/null
+++ b/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);
+}