mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Bump to Buildah v1.27.0
As the title says. Vendor Buildah v1.27.0 into Podman in preparation for Buildah v4.2 [No New Tests Needed] Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
This commit is contained in:
25
vendor/github.com/containers/buildah/pkg/util/uptime_freebsd.go
generated
vendored
Normal file
25
vendor/github.com/containers/buildah/pkg/util/uptime_freebsd.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// For some reason, unix.ClockGettime isn't implemented by x/sys/unix on FreeBSD
|
||||
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) {
|
||||
var uptime unix.Timespec
|
||||
if err := clockGettime(unix.CLOCK_UPTIME, &uptime); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return time.Duration(unix.TimespecToNsec(uptime)), nil
|
||||
}
|
||||
Reference in New Issue
Block a user