Source file
src/syscall/syscall_darwin_amd64.go
1
2
3
4
5 package syscall
6
7 import (
8 "internal/abi"
9 "unsafe"
10 )
11
12 func setTimespec(sec, nsec int64) Timespec {
13 return Timespec{Sec: sec, Nsec: nsec}
14 }
15
16 func setTimeval(sec, usec int64) Timeval {
17 return Timeval{Sec: sec, Usec: int32(usec)}
18 }
19
20
21
22
23
24
25
26
27
28
29 func SetKevent(k *Kevent_t, fd, mode, flags int) {
30 k.Ident = uint64(fd)
31 k.Filter = int16(mode)
32 k.Flags = uint16(flags)
33 }
34
35 func (iov *Iovec) SetLen(length int) {
36 iov.Len = uint64(length)
37 }
38
39 func (msghdr *Msghdr) SetControllen(length int) {
40 msghdr.Controllen = uint32(length)
41 }
42
43 func (cmsg *Cmsghdr) SetLen(length int) {
44 cmsg.Len = uint32(length)
45 }
46
47 func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
48 var length = uint64(count)
49
50 _, _, e1 := syscall6(abi.FuncPCABI0(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0)
51
52 written = int(length)
53
54 if e1 != 0 {
55 err = e1
56 }
57 return
58 }
59
60 func libc_sendfile_trampoline()
61
62
63
64 func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
65
View as plain text