Chromium Code Reviews| 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 e992c2784b6fc458991d2607d47a1eed796270e4..f560d3b125705959f41e69ed960a139222c8e6b6 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 |
| @@ -272,6 +272,11 @@ static void assign_real_pointers() { |
| if (!REAL(func)) \ |
| assign_real_pointers(); |
| +#define CHECK_REAL_NOSYS(func) \ |
| + CHECK_REAL(func) \ |
| + if (!REAL(func)) \ |
| + return ENOSYS; |
| + |
| // "real" functions, i.e. the unwrapped original functions. |
| int _real_close(int fd) { |
| @@ -354,6 +359,11 @@ int _real_write(int fd, const void* buf, size_t count, size_t* nwrote) { |
| return REAL(write)(fd, buf, count, nwrote); |
| } |
| +int _real_getcwd(char* pathname, size_t len) { |
|
binji
2014/08/20 18:13:35
bionic too?
Sam Clegg
2014/08/21 10:19:34
Done.. looks like we don't have a trybot that ev
|
| + CHECK_REAL_NOSYS(getcwd); |
| + return REAL(getcwd)(pathname, len); |
| +} |
| + |
| static bool s_wrapped = false; |
| void kernel_wrap_init() { |