1
2
3
4
5
6
7 package unix
8
9 import "syscall"
10
11 func setTimespec(sec, nsec int64) Timespec {
12 return Timespec{Sec: sec, Nsec: nsec}
13 }
14
15 func setTimeval(sec, usec int64) Timeval {
16 return Timeval{Sec: sec, Usec: int32(usec)}
17 }
18
19 func SetKevent(k *Kevent_t, fd, mode, flags int) {
20 k.Ident = uint64(fd)
21 k.Filter = int16(mode)
22 k.Flags = uint16(flags)
23 }
24
25 func (iov *Iovec) SetLen(length int) {
26 iov.Len = uint64(length)
27 }
28
29 func (msghdr *Msghdr) SetControllen(length int) {
30 msghdr.Controllen = uint32(length)
31 }
32
33 func (msghdr *Msghdr) SetIovlen(length int) {
34 msghdr.Iovlen = int32(length)
35 }
36
37 func (cmsg *Cmsghdr) SetLen(length int) {
38 cmsg.Len = uint32(length)
39 }
40
41 func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
42
43
44
45
46
47
48
49
50
51
View as plain text