2017-11-05 18:28:41 +00:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "syscall"
|
|
|
|
|
|
|
|
// Flimit defines the max number of watched files
|
2017-11-19 23:52:31 +00:00
|
|
|
func (s *Settings) Flimit() error {
|
2017-11-05 18:28:41 +00:00
|
|
|
var rLimit syscall.Rlimit
|
|
|
|
rLimit.Max = uint64(s.FileLimit)
|
|
|
|
rLimit.Cur = uint64(s.FileLimit)
|
|
|
|
|
|
|
|
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
|
|
|
|
}
|