Platform-specific setRLimit implementations

This commit is contained in:
Jordan Liggitt
2015-10-18 21:26:39 -04:00
parent 6341e1d3e2
commit 55cd3f1030
3 changed files with 48 additions and 5 deletions

View File

@@ -23,7 +23,6 @@ import (
"strings"
"sync"
"sync/atomic"
"syscall"
"time"
"github.com/golang/glog"
@@ -158,10 +157,6 @@ func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.In
return createProxier(loadBalancer, listenIP, iptables, hostIP, proxyPorts, syncPeriod)
}
func setRLimit(limit uint64) error {
return syscall.Setrlimit(syscall.RLIMIT_NOFILE, &syscall.Rlimit{Max: limit, Cur: limit})
}
func createProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.Interface, hostIP net.IP, proxyPorts PortAllocator, syncPeriod time.Duration) (*Proxier, error) {
// convenient to pass nil for tests..
if proxyPorts == nil {