cmd/utils: add check on fd hard limit, skip test if below target (#15684)
* cmd/utils: Add check on hard limit, skip test if below target * cmd/utils: Cross platform compatible fd limit test * cmd/utils: Remove syscall.Rlimit in test * cmd/utils: comment fd utility method
This commit is contained in:
@@ -48,3 +48,13 @@ func getFdLimit() (int, error) {
|
||||
}
|
||||
return int(limit.Cur), nil
|
||||
}
|
||||
|
||||
// getFdMaxLimit retrieves the maximum number of file descriptors this process is
|
||||
// allowed to request for itself.
|
||||
func getFdMaxLimit() (int, error) {
|
||||
var limit syscall.Rlimit
|
||||
if err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return int(limit.Max), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user