Add vendor dir (#16) (#4)

* Add vendor dir so builds dont require dep

* Pin specific version go-eth version
This commit is contained in:
Matt K
2018-01-29 13:44:18 -06:00
committed by GitHub
parent 82119b3c4b
commit 293dd2e848
4319 changed files with 1448696 additions and 26 deletions
+10
View File
@@ -0,0 +1,10 @@
// Copyright (c) 2013-2014 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package limits
// SetLimits is a no-op on Plan 9 due to the lack of process accounting.
func SetLimits() error {
return nil
}
+52
View File
@@ -0,0 +1,52 @@
// Copyright (c) 2013-2014 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
// +build !windows,!plan9
package limits
import (
"fmt"
"syscall"
)
const (
fileLimitWant = 2048
fileLimitMin = 1024
)
// SetLimits raises some process limits to values which allow btcd and
// associated utilities to run.
func SetLimits() error {
var rLimit syscall.Rlimit
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
return err
}
if rLimit.Cur > fileLimitWant {
return nil
}
if rLimit.Max < fileLimitMin {
err = fmt.Errorf("need at least %v file descriptors",
fileLimitMin)
return err
}
if rLimit.Max < fileLimitWant {
rLimit.Cur = rLimit.Max
} else {
rLimit.Cur = fileLimitWant
}
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
// try min value
rLimit.Cur = fileLimitMin
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil {
return err
}
}
return nil
}
+10
View File
@@ -0,0 +1,10 @@
// Copyright (c) 2013-2014 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package limits
// SetLimits is a no-op on Windows since it's not required there.
func SetLimits() error {
return nil
}