File: systemlimit.go

package info (click to toggle)
consul 1.8.7%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 57,848 kB
  • sloc: javascript: 25,918; sh: 3,807; makefile: 135; cpp: 102
file content (11 lines) | stat: -rw-r--r-- 208 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
// +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
}