blob: 1e91ddf3257c9aa5182596c95b13ac31a56aa5d9 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001// Copyright 2015 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build arm64,darwin
6
7package unix
8
9import (
10 "syscall"
11)
12
13func ptrace(request int, pid int, addr uintptr, data uintptr) error {
14 return ENOTSUP
15}
16
17func setTimespec(sec, nsec int64) Timespec {
18 return Timespec{Sec: sec, Nsec: nsec}
19}
20
21func setTimeval(sec, usec int64) Timeval {
22 return Timeval{Sec: sec, Usec: int32(usec)}
23}
24
25func SetKevent(k *Kevent_t, fd, mode, flags int) {
26 k.Ident = uint64(fd)
27 k.Filter = int16(mode)
28 k.Flags = uint16(flags)
29}
30
31func (iov *Iovec) SetLen(length int) {
32 iov.Len = uint64(length)
33}
34
35func (msghdr *Msghdr) SetControllen(length int) {
36 msghdr.Controllen = uint32(length)
37}
38
39func (msghdr *Msghdr) SetIovlen(length int) {
40 msghdr.Iovlen = int32(length)
41}
42
43func (cmsg *Cmsghdr) SetLen(length int) {
44 cmsg.Len = uint32(length)
45}
46
47func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
48
49// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
50// of darwin/arm64 the syscall is called sysctl instead of __sysctl.
51const SYS___SYSCTL = SYS_SYSCTL
52
53//sys Fstat(fd int, stat *Stat_t) (err error)
54//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
55//sys Fstatfs(fd int, stat *Statfs_t) (err error)
56//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
57//sys Lstat(path string, stat *Stat_t) (err error)
58//sys Stat(path string, stat *Stat_t) (err error)
59//sys Statfs(path string, stat *Statfs_t) (err error)