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); |