github.com/gopherjs/gopherjs@v1.19.0-beta1.0.20240506212314-27071a8796e4/internal/sysutil/sysutil.go (about) 1 //go:build !windows 2 // +build !windows 3 4 // Package sysutil contains system-specific utilities. 5 package sysutil 6 7 import "golang.org/x/sys/unix" 8 9 // RlimitStack reports the current stack size limit in bytes. 10 func RlimitStack() (cur uint64, err error) { 11 var r unix.Rlimit 12 err = unix.Getrlimit(unix.RLIMIT_STACK, &r) 13 return uint64(r.Cur), err // Type conversion because Cur is one of uint64, int64 depending on unix flavor. 14 }