Windows compilation fix; deps update

This commit is contained in:
L11R
2019-08-18 04:05:26 +03:00
parent b1074193a8
commit f14f104bea
5 changed files with 87 additions and 44 deletions
+25
View File
@@ -0,0 +1,25 @@
//+build !windows
package rlimit
import (
"github.com/juju/errors"
"golang.org/x/sys/unix"
)
func Set() (err error) {
rLimit := unix.RLimit{}
err = unix.Getrlimit(unix.RLIMIT_NOFILE, &rLimit)
if err != nil {
err = errors.Annotate(err, "Cannot get rlimit")
return
}
rLimit.Cur = rLimit.Max
err = unix.Setrlimit(unix.RLIMIT_NOFILE, &rLimit)
if err != nil {
err = errors.Annotate(err, "Cannot set rlimit")
}
return
}
+7
View File
@@ -0,0 +1,7 @@
// +build windows
package rlimit
func Set() (err error) {
return
}