aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--executor/common_bsd.h6
-rw-r--r--pkg/csource/generated.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/executor/common_bsd.h b/executor/common_bsd.h
index 0dcf6ff5f..652f3c660 100644
--- a/executor/common_bsd.h
+++ b/executor/common_bsd.h
@@ -280,9 +280,11 @@ static void sandbox_common()
// Some minimal sandboxing.
struct rlimit rlim;
-#ifndef GOOS_openbsd
+#ifdef GOOS_freebsd
// Documented bug in OpenBSD.
- // This causes frequent random aborts on netbsd. Reason unknown.
+ // This causes frequent random aborts. Reason unknown.
+
+ // This also causes ENOMEM on NetBSD during early init.
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
#endif
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 90a10799e..fc7953842 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -647,7 +647,7 @@ static void sandbox_common()
if (setsid() == -1)
fail("setsid failed");
struct rlimit rlim;
-#ifndef GOOS_openbsd
+#ifdef GOOS_freebsd
rlim.rlim_cur = rlim.rlim_max = 128 << 20;
setrlimit(RLIMIT_AS, &rlim);
#endif