OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/os_compat_android.h" | 5 #include "base/os_compat_android.h" |
6 | 6 |
7 #include <asm/unistd.h> | 7 #include <asm/unistd.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <math.h> | 9 #include <math.h> |
10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
11 #include <sys/syscall.h> | 11 #include <sys/syscall.h> |
12 #include <time64.h> | 12 #include <time64.h> |
13 | 13 |
14 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
15 #include "base/stringprintf.h" | |
16 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 16 #include "base/strings/stringprintf.h" |
17 | 17 |
18 extern "C" { | 18 extern "C" { |
19 // There is no futimes() avaiable in Bionic, so we provide our own | 19 // There is no futimes() avaiable in Bionic, so we provide our own |
20 // implementation until it is there. | 20 // implementation until it is there. |
21 int futimes(int fd, const struct timeval tv[2]) { | 21 int futimes(int fd, const struct timeval tv[2]) { |
22 if (tv == NULL) | 22 if (tv == NULL) |
23 return syscall(__NR_utimensat, fd, NULL, NULL, 0); | 23 return syscall(__NR_utimensat, fd, NULL, NULL, 0); |
24 | 24 |
25 if (tv[0].tv_usec < 0 || tv[0].tv_usec >= 1000000 || | 25 if (tv[0].tv_usec < 0 || tv[0].tv_usec >= 1000000 || |
26 tv[1].tv_usec < 0 || tv[1].tv_usec >= 1000000) { | 26 tv[1].tv_usec < 0 || tv[1].tv_usec >= 1000000) { |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // The directory doesn't exist, but an error occured | 161 // The directory doesn't exist, but an error occured |
162 return NULL; | 162 return NULL; |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 // We reached the max number of tries. | 166 // We reached the max number of tries. |
167 return NULL; | 167 return NULL; |
168 } | 168 } |
169 | 169 |
170 } // extern "C" | 170 } // extern "C" |
OLD | NEW |