realize/settings_unix.go
asoseil d91d01565d Merge branch 'dev' of https://github.com/tockins/realize into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2017-11-05 19:28:41 +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)
}