mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
Update vendor/
This commit is contained in:
22
vendor/github.com/cloudfoundry/gosigar/sigar_util.go
generated
vendored
Normal file
22
vendor/github.com/cloudfoundry/gosigar/sigar_util.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) 2012 VMware, Inc.
|
||||
|
||||
package sigar
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func bytePtrToString(ptr *int8) string {
|
||||
bytes := (*[10000]byte)(unsafe.Pointer(ptr))
|
||||
|
||||
n := 0
|
||||
for bytes[n] != 0 {
|
||||
n++
|
||||
}
|
||||
|
||||
return string(bytes[0:n])
|
||||
}
|
||||
|
||||
func chop(buf []byte) []byte {
|
||||
return buf[0 : len(buf)-1]
|
||||
}
|
Reference in New Issue
Block a user