mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
Vendor in latest containers(common, storage,image, buildah)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
25
vendor/github.com/containers/buildah/pkg/util/uptime_netbsd.go
generated
vendored
Normal file
25
vendor/github.com/containers/buildah/pkg/util/uptime_netbsd.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func clockGettime(clockid int32, time *unix.Timespec) (err error) {
|
||||
_, _, e1 := unix.Syscall(unix.SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
|
||||
if e1 != 0 {
|
||||
return e1
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func ReadUptime() (time.Duration, error) {
|
||||
tv, err := unix.SysctlTimeval("kern.boottime")
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
sec, nsec := tv.Unix()
|
||||
return time.Now().Sub(time.Unix(sec, nsec)), nil
|
||||
}
|
||||
Reference in New Issue
Block a user