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