Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2427)

Unified Diff: base/os_compat_android.cc

Issue 14649009: Android: Provide futimes() implementation using utimensat() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase after roll Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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().
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698