dd0e8eec14
* copyright headers for agent folder * Ignore test data files * fix proto files and remove headers in agent/uiserver folder * ignore deep-copy files
19 lines
480 B
Go
19 lines
480 B
Go
// Copyright (c) HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
//go:build !windows
|
|
// +build !windows
|
|
|
|
package config
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
// getrlimit return the max file descriptors allocated by system
|
|
// return the number of file descriptors max
|
|
func getrlimit() (uint64, error) {
|
|
var limit unix.Rlimit
|
|
err := unix.Getrlimit(unix.RLIMIT_NOFILE, &limit)
|
|
// nolint:unconvert // Rlimit.Cur may not be uint64 on all platforms
|
|
return uint64(limit.Cur), err
|
|
}
|