Vendor update gopacket and unix package
This commit is contained in:
1 parent
54d24e65ef
commit
43d3339b39
319 files changed
+91339
-13246
No files matched your search
+20
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user