aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShenghou Ma <minux.ma@gmail.com>2012-09-22 05:55:13 +1000
committerShenghou Ma <minux.ma@gmail.com>2012-09-22 05:55:13 +1000
commitc01c6c672d0fa8e84e9ba37b268c62db5968916e (patch)
tree1335c42a3cffce12cf911e97349e09cb45c643e9
parenta0adc4882303244109612126fce3f2026dbad874 (diff)
downloadgo-c01c6c672d0fa8e84e9ba37b268c62db5968916e.tar.gz
go-c01c6c672d0fa8e84e9ba37b268c62db5968916e.zip
[release-branch.go1] run.bash: set appropriate ulimits
««« backport a97b81d2600f run.bash: set appropriate ulimits mainly for NetBSD/OpenBSD. R=bradfitz, r, rsc CC=golang-dev https://golang.org/cl/6453154 »»»
-rwxr-xr-xsrc/run.bash6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/run.bash b/src/run.bash
index ca84b7034d..639cc55b45 100755
--- a/src/run.bash
+++ b/src/run.bash
@@ -14,6 +14,12 @@ unset GOPATH # we disallow local import for non-local packages, if $GOROOT ha
# no core files, please
ulimit -c 0
+# Raise soft limits to hard limits for NetBSD/OpenBSD.
+# We need at least 256 files and ~300 MB of bss.
+# On OS X ulimit -S -n rejects 'unlimited'.
+[ "$(ulimit -H -n)" == "unlimited" ] || ulimit -S -n $(ulimit -H -n)
+[ "$(ulimit -H -d)" == "unlimited" ] || ulimit -S -n $(ulimit -H -d)
+
# allow all.bash to avoid double-build of everything
rebuild=true
if [ "$1" = "--no-rebuild" ]; then