github.com/goplusjs/gopherjs@v1.2.6-0.20211206034512-f187917453b8/internal/sysutil/sysutil.go (about)

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