Index: src/untrusted/irt/irt_dev_mprotect.c |
diff --git a/src/untrusted/irt/irt_dev_getpid.c b/src/untrusted/irt/irt_dev_mprotect.c |
similarity index 60% |
copy from src/untrusted/irt/irt_dev_getpid.c |
copy to src/untrusted/irt/irt_dev_mprotect.c |
index 8360fc8eecbf6015a38f4b39c545fa1028851e31..d5edff7d6c07af609d4f34651aef4f4f5d194163 100644 |
--- a/src/untrusted/irt/irt_dev_getpid.c |
+++ b/src/untrusted/irt/irt_dev_mprotect.c |
@@ -4,18 +4,17 @@ |
* found in the LICENSE file. |
*/ |
+#include <errno.h> |
Mark Seaborn
2012/10/25 17:05:36
Nit: I don't think you need errno.h or stdint.h.
Petr Hosek
2012/10/25 18:46:57
Right, this is leftover.
|
+#include <stdint.h> |
+ |
#include "native_client/src/untrusted/irt/irt.h" |
#include "native_client/src/untrusted/irt/irt_interfaces.h" |
#include "native_client/src/untrusted/nacl/syscall_bindings_trampoline.h" |
-static int nacl_irt_dev_getpid_func(int *pid) { |
- int rv = NACL_SYSCALL(getpid)(); |
- if (rv < 0) |
- return -rv; |
- *pid = rv; |
- return 0; |
+static int nacl_irt_mprotect(void *addr, size_t len, int prot) { |
+ return -NACL_SYSCALL(mprotect)(addr, len, prot); |
} |
-const struct nacl_irt_dev_getpid nacl_irt_dev_getpid = { |
- nacl_irt_dev_getpid_func, |
+const struct nacl_irt_dev_mprotect nacl_irt_dev_mprotect = { |
+ nacl_irt_mprotect, |
}; |