Chromium Code Reviews| Index: src/untrusted/nacl/sys_private.c |
| diff --git a/src/untrusted/nacl/sys_private.c b/src/untrusted/nacl/sys_private.c |
| index c9d31f3a9e315d2683a4c040580d9ae60af8056b..3e40f2a7e7352261291c1e4af66c74fdbd227115 100644 |
| --- a/src/untrusted/nacl/sys_private.c |
| +++ b/src/untrusted/nacl/sys_private.c |
| @@ -23,10 +23,11 @@ |
| #include <sched.h> |
| #include <stdarg.h> |
| #include <stdint.h> |
| +#include <sys/mman.h> |
| +#include <sys/types.h> |
| #include <time.h> |
| #include <unistd.h> |
| -#include <sys/types.h> |
| -#include <sys/mman.h> |
| +#include <utime.h> |
| #include "native_client/src/include/elf32.h" |
| #include "native_client/src/untrusted/nacl/getcwd.h" |
| @@ -252,6 +253,19 @@ int readlink(const char *path, char *buf, int bufsize) { |
| return errno_value_call(NACL_SYSCALL(readlink)(path, buf, bufsize)); |
| } |
| +int utime(const char *path, const struct utimbuf *buf) { |
|
Mark Seaborn
2015/04/07 19:08:43
If utime.c calls utimes(), you don't need this her
Sam Clegg
2015/04/10 21:18:55
Good idea. Done.
|
| + struct timeval times[2]; |
| + struct timeval* tv = NULL; |
|
Mark Seaborn
2015/04/07 19:08:43
Use " *" spacing
Sam Clegg
2015/04/10 21:18:55
Acknowledged.
|
| + if (buf != NULL) { |
| + times[0].tv_sec = buf->actime; |
| + times[1].tv_sec = buf->modtime; |
| + times[0].tv_usec = 0; |
| + times[1].tv_usec = 0; |
| + tv = times; |
| + } |
| + return errno_value_call(NACL_SYSCALL(utimes)(path, tv)); |
| +} |
| + |
| int utimes(const char *path, const struct timeval times[2]) { |
| return errno_value_call(NACL_SYSCALL(utimes)(path, times)); |
| } |