ipld-eth-server/vendor/github.com/libp2p/go-libp2p-kad-dht/nofile_test_posix.go

13 lines
236 B
Go
Raw Normal View History

// +build !windows,!wasm
package dht
import "syscall"
func curFileLimit() uint64 {
var n syscall.Rlimit
syscall.Getrlimit(syscall.RLIMIT_NOFILE, &n)
// cast because some platforms use int64 (e.g., freebsd)
return uint64(n.Cur)
}