mirror of https://github.com/n1nj4sec/pupy.git
Set rlimits to maximum on linux
This commit is contained in:
parent
990e3cfbfe
commit
a05b912d0c
|
@ -0,0 +1,20 @@
|
||||||
|
// +build linux
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"syscall"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
log.Warning("Set rlimits")
|
||||||
|
limits := &syscall.Rlimit{}
|
||||||
|
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, limits)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalln("Couldn't get rlimit value: ", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
limits.Cur = limits.Max
|
||||||
|
syscall.Setrlimit(syscall.RLIMIT_NOFILE, limits)
|
||||||
|
}
|
Loading…
Reference in New Issue