aboutsummaryrefslogtreecommitdiffstats
path: root/executor/executor_bsd.cc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-25 18:33:42 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-25 18:36:49 +0200
commitbc5423304f0adea0d3fc99f31b390a1cc3133cb0 (patch)
tree1fb5f05a648b103ebfa2d41529ed7fa80dfd5894 /executor/executor_bsd.cc
parent644a9f03f9bf21685052a2559a363f06a6a78fb8 (diff)
executor: small fixes for netbsd
RLIMIT_AS auses frequent random aborts on netbsd. Reason unknown. Disable it for now. Documentation says that __syscall should be used for syscalls with 64-bit arguments. On amd64 most syscalls have 64-bit arguments (incl mmap), so switch to it.
Diffstat (limited to 'executor/executor_bsd.cc')
-rw-r--r--executor/executor_bsd.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/executor/executor_bsd.cc b/executor/executor_bsd.cc
index d920c82f5..da5e10418 100644
--- a/executor/executor_bsd.cc
+++ b/executor/executor_bsd.cc
@@ -18,6 +18,7 @@
#else
// This is just so that "make executor TARGETOS=freebsd" works on linux.
#include "syscalls_freebsd.h"
+#define __syscall syscall
#endif
#include <signal.h>
@@ -58,8 +59,11 @@ int main(int argc, char** argv)
// Some minimal sandboxing.
struct rlimit rlim;
+#ifndef __NetBSD__
+ // This causes frequent random aborts on netbsd. Reason unknown.
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
+#endif
rlim.rlim_cur = rlim.rlim_max = 8 << 20;
setrlimit(RLIMIT_MEMLOCK, &rlim);
rlim.rlim_cur = rlim.rlim_max = 1 << 20;
@@ -129,7 +133,7 @@ long execute_syscall(call_t* c, long a0, long a1, long a2, long a3, long a4, lon
{
if (c->call)
return c->call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
- return syscall(c->sys_nr, a0, a1, a2, a3, a4, a5);
+ return __syscall(c->sys_nr, a0, a1, a2, a3, a4, a5, a6, a7, a8);
}
void cover_open()