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

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

Issue 59883020: [NaCl SDK] nacl_io: Enable isatty running under sel_ldr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 0809866547ba522e6b8720ddeab08f0fb86c6aa7..47a8024f2bf673ee6f00051720a37f6a275f56ca 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
@@ -67,6 +67,7 @@ extern struct nacl_irt_memory __libnacl_irt_memory;
OP(dev_fdio, fsync); \
OP(dev_fdio, fdatasync); \
OP(dev_fdio, ftruncate); \
+ OP(dev_fdio, isatty); \
OP(dev_filename, open); \
OP(dev_filename, stat); \
OP(dev_filename, mkdir); \
@@ -152,6 +153,13 @@ int WRAP(ftruncate)(int fd, off_t length) {
return (ki_ftruncate(fd, length) < 0) ? errno : 0;
}
+int WRAP(isatty)(int fd, int* result) {
+ *result = ki_isatty(fd);
+ if (*result == 1)
+ return errno;
+ return 0;
+}
+
int WRAP(mmap)(void** addr, size_t length, int prot, int flags, int fd,
off_t offset) {
if (flags & MAP_ANONYMOUS)
@@ -266,6 +274,11 @@ int _real_fstat(int fd, struct stat* buf) {
return REAL(fstat)(fd, buf);
}
+int _real_isatty(int fd, int* result) {
+ CHECK_REAL(isatty);
+ return REAL(isatty)(fd, result);
+}
+
int _real_getdents(int fd, void* nacl_buf, size_t nacl_count, size_t* nread) {
CHECK_REAL(getdents);
return REAL(getdents)(fd, static_cast<dirent*>(nacl_buf), nacl_count, nread);
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | native_client_sdk/src/libraries/nacl_io/kernel_wrap_real.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698