1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00

Update vendor

This commit is contained in:
Darren Shepherd
2016-05-31 18:12:52 -07:00
parent 410dfbe0fd
commit a14846152b
1253 changed files with 222820 additions and 15054 deletions

18
vendor/github.com/docker/containerd/osutils/fds.go generated vendored Normal file
View File

@@ -0,0 +1,18 @@
// +build !windows,!darwin
package osutils
import (
"io/ioutil"
"path/filepath"
"strconv"
)
// GetOpenFds returns the number of open fds for the process provided by pid
func GetOpenFds(pid int) (int, error) {
dirs, err := ioutil.ReadDir(filepath.Join("/proc", strconv.Itoa(pid), "fd"))
if err != nil {
return -1, err
}
return len(dirs), nil
}