| 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 // The entire file is wrapped in this #if. We do this so this .cc file can be | 5 // The entire file is wrapped in this #if. We do this so this .cc file can be |
| 6 // compiled, even on a non-Windows build. | 6 // compiled, even on a non-Windows build. |
| 7 #if defined(WIN32) | 7 #if defined(WIN32) |
| 8 | 8 |
| 9 #include "nacl_io/kernel_wrap.h" | 9 #include "nacl_io/kernel_wrap.h" |
| 10 #include <errno.h> | 10 #include <errno.h> |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 int _real_rmdir(const char* pathname) { | 301 int _real_rmdir(const char* pathname) { |
| 302 return ENOSYS; | 302 return ENOSYS; |
| 303 } | 303 } |
| 304 | 304 |
| 305 int _real_write(int fd, const void *buf, size_t count, size_t *nwrote) { | 305 int _real_write(int fd, const void *buf, size_t count, size_t *nwrote) { |
| 306 *nwrote = count; | 306 *nwrote = count; |
| 307 return 0; | 307 return 0; |
| 308 } | 308 } |
| 309 | 309 |
| 310 #define USECS_FROM_WIN_TO_TO_UNIX_EPOCH 11644473600000LL |
| 311 uint64_t usec_since_epoch() { |
| 312 FILETIME ft; |
| 313 ULARGE_INTEGER ularge; |
| 314 GetSystemTimeAsFileTime(&ft); |
| 315 |
| 316 ularge.LowPart = ft.dwLowDateTime; |
| 317 ularge.HighPart = ft.dwHighDateTime; |
| 318 |
| 319 // Truncate to usec resolution. |
| 320 return usecs = ularge.QuadPart / 10; |
| 321 } |
| 322 |
| 310 // Do nothing for Windows, we replace the library at link time. | 323 // Do nothing for Windows, we replace the library at link time. |
| 311 void kernel_wrap_init() { | 324 void kernel_wrap_init() { |
| 312 } | 325 } |
| 313 EXTERN_C_END | 326 EXTERN_C_END |
| 314 | 327 |
| 315 #endif // defined(WIN32) | 328 #endif // defined(WIN32) |
| 316 | 329 |
| OLD | NEW |