Index: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
index cf6cf07cf0517bc3dfd4cf09c2e29ede0b8ccf3d..b5cf443c7dbc77e49d1411adb30471a678467b65 100644 |
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc |
@@ -799,8 +799,7 @@ int KernelProxy::remove(const char* path) { |
return 0; |
} |
-// TODO(noelallen): Needs implementation. |
-int KernelProxy::fchmod(int fd, int mode) { |
+int KernelProxy::fchmod(int fd, mode_t mode) { |
ScopedKernelHandle handle; |
Error error = AcquireHandle(fd, &handle); |
if (error) { |
@@ -808,6 +807,12 @@ int KernelProxy::fchmod(int fd, int mode) { |
return -1; |
} |
+ error = handle->node()->Fchmod(mode); |
+ if (error) { |
+ errno = error; |
+ return -1; |
+ } |
+ |
return 0; |
} |