realize/settings/flimit.go
alessio 972898c0b5 realize init cmd
clean, config commands
doc improved
run command improved
2017-03-12 23:46:58 +01:00

17 lines
358 B
Go

// +build !windows
package settings
import "syscall"
// Flimit defines the max number of watched files
func (s *Settings) Flimit() {
var rLimit syscall.Rlimit
rLimit.Max = uint64(s.Config.Flimit)
rLimit.Cur = uint64(s.Config.Flimit)
err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
s.Fatal(err, "Error setting rlimit")
}
}