realize/settings/flimit.go

17 lines
342 B
Go
Raw Normal View History

2016-11-21 22:22:46 +00:00
// +build !windows
2016-11-21 22:10:55 +00:00
package settings
import "syscall"
// Flimit defines the max number of watched files
func (s *Settings) Flimit() {
var rLimit syscall.Rlimit
rLimit.Max = s.Config.Flimit
rLimit.Cur = s.Config.Flimit
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
s.Fatal("Error Setting Rlimit", err)
}
}