realize/settings_unix.go
2017-11-01 17:11:10 +01:00

15 lines
294 B
Go

// +build !windows
package main
import "syscall"
// Flimit defines the max number of watched files
func (s *Settings) flimit() error {
var rLimit syscall.Rlimit
rLimit.Max = uint64(s.FileLimit)
rLimit.Cur = uint64(s.FileLimit)
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
}