diff options
author | Ian Lance Taylor <iant@golang.org> | 2016-06-28 17:06:59 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-06-29 01:37:19 +0000 |
commit | c7ae41e5770b2258074eee68a6a3c4d0d71a251f (patch) | |
tree | e45eaa1de22e70f69c64e4eaad62484fdcf7fdfa /src/runtime/os_netbsd.go | |
parent | 8641e6fe2131ac342647fa34398a727f96d15fb5 (diff) | |
download | go-git-c7ae41e5770b2258074eee68a6a3c4d0d71a251f.tar.gz |
runtime: better error message for newosproc failure
If creating a new thread fails with EAGAIN, point the user at ulimit.
Fixes #15476.
Change-Id: Ib36519614b5c72776ea7f218a0c62df1dd91a8ea
Reviewed-on: https://go-review.googlesource.com/24570
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/os_netbsd.go')
-rw-r--r-- | src/runtime/os_netbsd.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/runtime/os_netbsd.go b/src/runtime/os_netbsd.go index 41f34f7132..4c44b2bb20 100644 --- a/src/runtime/os_netbsd.go +++ b/src/runtime/os_netbsd.go @@ -20,6 +20,8 @@ const ( // From NetBSD's <sys/ucontext.h> _UC_SIGMASK = 0x01 _UC_CPU = 0x04 + + _EAGAIN = 35 ) type mOS struct { @@ -162,6 +164,9 @@ func newosproc(mp *m, stk unsafe.Pointer) { ret := lwp_create(unsafe.Pointer(&uc), 0, unsafe.Pointer(&mp.procid)) if ret < 0 { print("runtime: failed to create new OS thread (have ", mcount()-1, " already; errno=", -ret, ")\n") + if ret == -_EAGAIN { + println("runtime: may need to increase max user processes (ulimit -p)") + } throw("runtime.newosproc") } } |