diff --git a/unix/syscall.go b/unix/syscall.go index 6442a993..a0bcf842 100644 --- a/unix/syscall.go +++ b/unix/syscall.go @@ -68,6 +68,8 @@ func (tv *Timeval) Nano() int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 } +func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } + // use is a no-op, but the compiler cannot see that it is. // Calling use(p) ensures that p is kept live until that point. //go:noescape diff --git a/unix/syscall_darwin_386.go b/unix/syscall_darwin_386.go index 3195c8bf..c172a3da 100644 --- a/unix/syscall_darwin_386.go +++ b/unix/syscall_darwin_386.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_darwin_amd64.go b/unix/syscall_darwin_amd64.go index 7adb98de..fc1e5a4a 100644 --- a/unix/syscall_darwin_amd64.go +++ b/unix/syscall_darwin_amd64.go @@ -23,8 +23,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_darwin_arm.go b/unix/syscall_darwin_arm.go index e47ffd73..d286cf40 100644 --- a/unix/syscall_darwin_arm.go +++ b/unix/syscall_darwin_arm.go @@ -19,8 +19,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_darwin_arm64.go b/unix/syscall_darwin_arm64.go index 2560a959..c33905cd 100644 --- a/unix/syscall_darwin_arm64.go +++ b/unix/syscall_darwin_arm64.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_dragonfly_386.go b/unix/syscall_dragonfly_386.go index 41c2e697..60fec8ce 100644 --- a/unix/syscall_dragonfly_386.go +++ b/unix/syscall_dragonfly_386.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_dragonfly_amd64.go b/unix/syscall_dragonfly_amd64.go index 2ed92590..da7cb798 100644 --- a/unix/syscall_dragonfly_amd64.go +++ b/unix/syscall_dragonfly_amd64.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = nsec % 1e9 / 1e3 diff --git a/unix/syscall_freebsd_386.go b/unix/syscall_freebsd_386.go index 6255d40f..6a0cd804 100644 --- a/unix/syscall_freebsd_386.go +++ b/unix/syscall_freebsd_386.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_freebsd_amd64.go b/unix/syscall_freebsd_amd64.go index 8b395d59..e142540e 100644 --- a/unix/syscall_freebsd_amd64.go +++ b/unix/syscall_freebsd_amd64.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = nsec % 1e9 / 1e3 diff --git a/unix/syscall_freebsd_arm.go b/unix/syscall_freebsd_arm.go index 4e72d46a..5504cb12 100644 --- a/unix/syscall_freebsd_arm.go +++ b/unix/syscall_freebsd_arm.go @@ -21,8 +21,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return tv.Sec*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_linux_386.go b/unix/syscall_linux_386.go index 45844015..d5dde1b9 100644 --- a/unix/syscall_linux_386.go +++ b/unix/syscall_linux_386.go @@ -24,8 +24,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = int32(nsec / 1e9) diff --git a/unix/syscall_linux_amd64.go b/unix/syscall_linux_amd64.go index 60698e44..b7fa9e4f 100644 --- a/unix/syscall_linux_amd64.go +++ b/unix/syscall_linux_amd64.go @@ -96,8 +96,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = nsec / 1e9 diff --git a/unix/syscall_linux_arm64.go b/unix/syscall_linux_arm64.go index 1f6f4b9a..9e2e8b72 100644 --- a/unix/syscall_linux_arm64.go +++ b/unix/syscall_linux_arm64.go @@ -79,8 +79,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = nsec / 1e9 diff --git a/unix/syscall_linux_mips64x.go b/unix/syscall_linux_mips64x.go index f23dd6c3..ce7b420c 100644 --- a/unix/syscall_linux_mips64x.go +++ b/unix/syscall_linux_mips64x.go @@ -85,8 +85,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = nsec / 1e9 diff --git a/unix/syscall_linux_ppc64x.go b/unix/syscall_linux_ppc64x.go index 20a1c230..9560ffa6 100644 --- a/unix/syscall_linux_ppc64x.go +++ b/unix/syscall_linux_ppc64x.go @@ -73,8 +73,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Sec = nsec / 1e9 diff --git a/unix/syscall_netbsd_386.go b/unix/syscall_netbsd_386.go index 1b0e1af1..afaca098 100644 --- a/unix/syscall_netbsd_386.go +++ b/unix/syscall_netbsd_386.go @@ -16,8 +16,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_netbsd_amd64.go b/unix/syscall_netbsd_amd64.go index 1b6dcbe3..a6ff04ce 100644 --- a/unix/syscall_netbsd_amd64.go +++ b/unix/syscall_netbsd_amd64.go @@ -16,8 +16,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_netbsd_arm.go b/unix/syscall_netbsd_arm.go index 87d1d6fe..68a6969b 100644 --- a/unix/syscall_netbsd_arm.go +++ b/unix/syscall_netbsd_arm.go @@ -16,8 +16,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_openbsd_386.go b/unix/syscall_openbsd_386.go index 9529b20e..a66ddc59 100644 --- a/unix/syscall_openbsd_386.go +++ b/unix/syscall_openbsd_386.go @@ -16,8 +16,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = int32(nsec % 1e9 / 1e3) diff --git a/unix/syscall_openbsd_amd64.go b/unix/syscall_openbsd_amd64.go index fc640294..0776c1fa 100644 --- a/unix/syscall_openbsd_amd64.go +++ b/unix/syscall_openbsd_amd64.go @@ -16,8 +16,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = nsec % 1e9 / 1e3 diff --git a/unix/syscall_solaris_amd64.go b/unix/syscall_solaris_amd64.go index 2e44630c..5aff62c3 100644 --- a/unix/syscall_solaris_amd64.go +++ b/unix/syscall_solaris_amd64.go @@ -14,8 +14,6 @@ func NsecToTimespec(nsec int64) (ts Timespec) { return } -func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } - func NsecToTimeval(nsec int64) (tv Timeval) { nsec += 999 // round up to microsecond tv.Usec = nsec % 1e9 / 1e3