Files
go-libp2p/p2p/host/resource-manager/sys_unix.go
web3-bot 3a66ff89a1 sync: update CI config files (#2073)
* bump go.mod to Go 1.19 and run go fix

* stop using the deprecated io/ioutil package

* bump go.mod to Go 1.19 and run go fix

* bump go.mod to Go 1.19 and run go fix

* bump go.mod to Go 1.19 and run go fix

* stop using the deprecated io/ioutil package

* bump go.mod to Go 1.19 and run go fix

* stop using the deprecated io/ioutil package

* update .github/workflows/go-test.yml

* update .github/workflows/go-check.yml

* update .github/workflows/release-check.yml

* various fixes

* stop using deprecated math/rand.Read

---------

Co-authored-by: web3-bot <web3-bot@users.noreply.github.com>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-02-12 01:18:10 -08:00

17 lines
274 B
Go

//go:build linux || darwin
package rcmgr
import (
"golang.org/x/sys/unix"
)
func getNumFDs() int {
var l unix.Rlimit
if err := unix.Getrlimit(unix.RLIMIT_NOFILE, &l); err != nil {
log.Errorw("failed to get fd limit", "error", err)
return 0
}
return int(l.Cur)
}