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

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.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_glibc.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
index 61662e80579150f8fc91c32e6890e0ea9e9f2b1a..c32c4b5befe00459b12ce34b5df5b76e08b0a1de 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
@@ -18,6 +18,7 @@
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include "nacl_io/kernel_intercept.h"
@@ -137,7 +138,7 @@ int WRAP(chdir) (const char* pathname) {
return (ki_chdir(pathname)) ? errno : 0;
}
-int chown(const char* path, uid_t owner, gid_t group) {
+int chown(const char* path, uid_t owner, gid_t group) NOTHROW {
return ki_chown(path, owner, group);
}
@@ -154,7 +155,7 @@ int WRAP(dup2)(int fd, int newfd) NOTHROW {
return (ki_dup2(fd, newfd) < 0) ? errno : 0;
}
-int fchown(int fd, uid_t owner, gid_t group) {
+int fchown(int fd, uid_t owner, gid_t group) NOTHROW {
return ki_fchown(fd, owner, group);
}
@@ -230,7 +231,7 @@ int isatty(int fd) NOTHROW {
return ki_isatty(fd);
}
-int lchown(const char* path, uid_t owner, gid_t group) {
+int lchown(const char* path, uid_t owner, gid_t group) NOTHROW {
return ki_lchown(path, owner, group);
}
@@ -423,6 +424,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;
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_wrap.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_wrap_newlib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698