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

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc

Issue 19271009: [NaCl SDK} Add EventListener and EventEmitter to support epoll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remerge Created 7 years, 5 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
Index: native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc
index af314921cf86717f54e48913cbe1ff4724c7cd33..ff5896fda46bcd606695f2eabbc111976ff07bf2 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc
@@ -14,6 +14,7 @@
#include <irt.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include "nacl_io/kernel_intercept.h"
EXTERN_C_BEGIN
@@ -261,6 +262,11 @@ int _real_write(int fd, const void *buf, size_t count, size_t *nwrote) {
return REAL(write)(fd, buf, count, nwrote);
}
+uint64_t usec_since_epoch() {
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_usec + (tv.tv_sec * 1000000);
+}
void kernel_wrap_init() {
static bool wrapped = false;

Powered by Google App Engine
This is Rietveld 408576698