1// +build !windows 2 3package config 4 5import "golang.org/x/sys/unix" 6 7// getrlimit return the max file descriptors allocated by system 8// return the number of file descriptors max 9func getrlimit() (uint64, error) { 10 var limit unix.Rlimit 11 err := unix.Getrlimit(unix.RLIMIT_NOFILE, &limit) 12 // nolint:unconvert // Rlimit.Cur may not be uint64 on all platforms 13 return uint64(limit.Cur), err 14} 15