Index: sandbox/linux/seccomp-bpf/syscall.h |
diff --git a/sandbox/linux/seccomp-bpf/syscall.h b/sandbox/linux/seccomp-bpf/syscall.h |
index f444d3a36303e52dd1e6498dcded12633b764c90..4f29776f775dbef6a4acea8118be31c839840621 100644 |
--- a/sandbox/linux/seccomp-bpf/syscall.h |
+++ b/sandbox/linux/seccomp-bpf/syscall.h |
@@ -11,6 +11,8 @@ |
namespace sandbox { |
+// This function will return the kernel return value on success and -errno on |
+// error on all architectures. |
// We have to make sure that we have a single "magic" return address for |
// our system calls, which we can check from within a BPF filter. This |
// works by writing a little bit of asm() code that a) enters the kernel, and |
@@ -25,6 +27,21 @@ SANDBOX_EXPORT intptr_t SandboxSyscall(int nr, |
intptr_t p4, |
intptr_t p5); |
+#if defined(__mips__) |
+// This function basically does on MIPS what SandboxSyscall() is doing on |
+// othere architectures. However, because of specificity of MIPS regarding |
+// handelling syscall errors, SandboxSyscall() is made as a wrapper for this |
+// function in order for SandboxSyscall() to behave more like on othere |
jln (very slow on Chromium)
2014/06/13 02:47:36
nit: othere -> other
nedeljko
2014/06/18 13:41:00
Done.
|
+// architectures on places where return value from SandboxSyscall() is used |
+// directly (like in most tests). |
+// The syscall "nr" is called with arguments that are set in an array on which |
+// pointer "args" points to and an information weather there is an error or no |
+// is returned to SandboxSyscall() by err_stat. |
+intptr_t SandboxSyscallRaw(int nr, |
+ const intptr_t *args, |
jln (very slow on Chromium)
2014/06/13 02:47:36
Nit: indent (simply use "git cl format").
nedeljko
2014/06/18 13:41:00
Done.
|
+ intptr_t* err_stat); |
+#endif // defined(__mips__) |
+ |
// System calls can take up to six parameters. Traditionally, glibc |
// implements this property by using variadic argument lists. This works, but |
// confuses modern tools such as valgrind, because we are nominally passing |