windows flimit fix

This commit is contained in:
alessio 2016-11-21 23:10:55 +01:00
parent f6d63cc8ab
commit 586fd218f5
2 changed files with 24 additions and 0 deletions

16
settings/flimit.go Normal file
View File

@ -0,0 +1,16 @@
// build !windows
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)
}
}

View File

@ -0,0 +1,8 @@
package settings
import "syscall"
// Flimit defines the max number of watched files
func (s *Settings) Flimit() {
return
}