Files
skald/limit/limit_unix.go
Juliusz Chroboczek 90a0a2e318 Don't attempt to set file descriptor limit.
Recent versions of Go do it at startup, so only print
a warning if the limit is too low.
2024-05-27 00:02:31 +02:00

19 lines
246 B
Go

//go:build unix
package limit
import (
"golang.org/x/sys/unix"
)
func Nofile() (uint64, error) {
var limit unix.Rlimit
err := unix.Getrlimit(unix.RLIMIT_NOFILE, &limit)
if err != nil {
return 0, err
}
return uint64(limit.Cur), nil
}