2023-03-28 22:48:58 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2021-11-16 18:04:01 +00:00
|
|
|
//go:build !windows
|
2020-01-17 22:27:13 +00:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package freeport
|
|
|
|
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
|
|
|
|
func systemLimit() (int, error) {
|
|
|
|
var limit unix.Rlimit
|
|
|
|
err := unix.Getrlimit(unix.RLIMIT_NOFILE, &limit)
|
|
|
|
return int(limit.Cur), err
|
|
|
|
}
|