Vendor update gopacket and unix package

This commit is contained in:
Manjunath A Kumatagi committed 2019-02-01 21:28:56 -06:00
1 parent 54d24e65ef
commit 43d3339b39
319 files changed
+91339 -13246

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
// +build darwin
package raw
import (
"syscall"
"time"
)
// newTimeval transforms a duration into a syscall.Timeval struct.
// An error is returned in case of zero time value.
func newTimeval(timeout time.Duration) (*syscall.Timeval, error) {
if timeout < time.Microsecond {
return nil, &timeoutError{}
}
return &syscall.Timeval{
Sec: int64(timeout / time.Second),
Usec: int32(timeout % time.Second / time.Microsecond),
}, nil
}