Vendor dependencies
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
9f1a65e941
commit
e17cf1ad4f
474 changed files with 71500 additions and 0 deletions
26
vendor/src/github.com/cloudfoundry/gosigar/sigar_unix.go
vendored
Normal file
26
vendor/src/github.com/cloudfoundry/gosigar/sigar_unix.go
vendored
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) 2012 VMware, Inc.
|
||||
|
||||
// +build darwin freebsd linux netbsd openbsd
|
||||
|
||||
package sigar
|
||||
|
||||
import "syscall"
|
||||
|
||||
func (self *FileSystemUsage) Get(path string) error {
|
||||
stat := syscall.Statfs_t{}
|
||||
err := syscall.Statfs(path, &stat)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
bsize := stat.Bsize / 512
|
||||
|
||||
self.Total = (uint64(stat.Blocks) * uint64(bsize)) >> 1
|
||||
self.Free = (uint64(stat.Bfree) * uint64(bsize)) >> 1
|
||||
self.Avail = (uint64(stat.Bavail) * uint64(bsize)) >> 1
|
||||
self.Used = self.Total - self.Free
|
||||
self.Files = stat.Files
|
||||
self.FreeFiles = stat.Ffree
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue