mirror of
https://source.quilibrium.com/quilibrium/ceremonyclient.git
synced 2024-11-14 12:15:18 +00:00
17 lines
274 B
Go
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)
|
||
|
}
|