Index: base/os_compat_android.cc |
diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc |
index c4ea463d1781a4fba039e323e90bf39ee276b52d..81cd8127e437c72506955a7eb154c9ed723f63b3 100644 |
--- a/base/os_compat_android.cc |
+++ b/base/os_compat_android.cc |
@@ -4,22 +4,22 @@ |
#include "base/os_compat_android.h" |
+#include <asm/unistd.h> |
#include <errno.h> |
#include <math.h> |
#include <sys/stat.h> |
+#include <sys/syscall.h> |
#include <time64.h> |
#include "base/rand_util.h" |
#include "base/stringprintf.h" |
#include "base/strings/string_piece.h" |
+extern "C" { |
// There is no futimes() avaiable in Bionic, so we provide our own |
// implementation until it is there. |
-extern "C" { |
- |
int futimes(int fd, const struct timeval tv[2]) { |
- const std::string fd_path = base::StringPrintf("/proc/self/fd/%d", fd); |
- return utimes(fd_path.c_str(), tv); |
+ return syscall(__NR_utimensat, fd, NULL, tv, 0); |
Mark Mentovai
2013/06/06 00:50:59
utimensat can be used to implement futimens. The t
nilesh
2013/06/06 01:57:36
Thanks for catching this. I am now converting time
|
} |
// Android has only timegm64() and no timegm(). |