forked from ebhomengo/niki
1
0
Fork 0
niki/vendor/golang.org/x/sys/unix/syscall_freebsd.go

787 lines
16 KiB
Go
Raw Normal View History

2024-02-18 10:42:21 +00:00
// Copyright 2009,2010 The Go Authors. All rights reserved.
2024-02-18 10:42:21 +00:00
// Use of this source code is governed by a BSD-style
2024-02-18 10:42:21 +00:00
// license that can be found in the LICENSE file.
// FreeBSD system calls.
2024-02-18 10:42:21 +00:00
// This file is compiled as ordinary Go code,
2024-02-18 10:42:21 +00:00
// but it is also input to mksyscall,
2024-02-18 10:42:21 +00:00
// which parses the //sys lines and generates system call stubs.
2024-02-18 10:42:21 +00:00
// Note that sometimes we use a lowercase //sys name and wrap
2024-02-18 10:42:21 +00:00
// it in our own nicer implementation, either here or in
2024-02-18 10:42:21 +00:00
// syscall_bsd.go or syscall_unix.go.
package unix
import (
2024-05-14 13:07:09 +00:00
"errors"
2024-02-18 10:42:21 +00:00
"sync"
"unsafe"
)
// See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html.
2024-02-18 10:42:21 +00:00
var (
osreldateOnce sync.Once
osreldate uint32
2024-02-18 10:42:21 +00:00
)
func supportsABI(ver uint32) bool {
2024-02-18 10:42:21 +00:00
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
2024-02-18 10:42:21 +00:00
return osreldate >= ver
2024-02-18 10:42:21 +00:00
}
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
2024-02-18 10:42:21 +00:00
type SockaddrDatalink struct {
Len uint8
2024-02-18 10:42:21 +00:00
Family uint8
Index uint16
Type uint8
Nlen uint8
Alen uint8
Slen uint8
Data [46]int8
raw RawSockaddrDatalink
2024-02-18 10:42:21 +00:00
}
func anyToSockaddrGOOS(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
2024-02-18 10:42:21 +00:00
return nil, EAFNOSUPPORT
2024-02-18 10:42:21 +00:00
}
// Translate "kern.hostname" to []_C_int{0,1,2,3}.
2024-02-18 10:42:21 +00:00
func nametomib(name string) (mib []_C_int, err error) {
2024-02-18 10:42:21 +00:00
const siz = unsafe.Sizeof(mib[0])
// NOTE(rsc): It seems strange to set the buffer to have
2024-02-18 10:42:21 +00:00
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
2024-02-18 10:42:21 +00:00
// as the size. I don't know why the +2 is here, but the
2024-02-18 10:42:21 +00:00
// kernel uses +2 for its own implementation of this function.
2024-02-18 10:42:21 +00:00
// I am scared that if we don't include the +2 here, the kernel
2024-02-18 10:42:21 +00:00
// will silently write 2 words farther than we specify
2024-02-18 10:42:21 +00:00
// and we'll get memory corruption.
2024-02-18 10:42:21 +00:00
var buf [CTL_MAXNAME + 2]_C_int
2024-02-18 10:42:21 +00:00
n := uintptr(CTL_MAXNAME) * siz
p := (*byte)(unsafe.Pointer(&buf[0]))
2024-02-18 10:42:21 +00:00
bytes, err := ByteSliceFromString(name)
2024-02-18 10:42:21 +00:00
if err != nil {
2024-02-18 10:42:21 +00:00
return nil, err
2024-02-18 10:42:21 +00:00
}
// Magic sysctl: "setting" 0.3 to a string name
2024-02-18 10:42:21 +00:00
// lets you read back the array of integers form.
2024-02-18 10:42:21 +00:00
if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
2024-02-18 10:42:21 +00:00
return nil, err
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return buf[0 : n/siz], nil
2024-02-18 10:42:21 +00:00
}
func direntIno(buf []byte) (uint64, bool) {
2024-02-18 10:42:21 +00:00
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
2024-02-18 10:42:21 +00:00
}
func direntReclen(buf []byte) (uint64, bool) {
2024-02-18 10:42:21 +00:00
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
2024-02-18 10:42:21 +00:00
}
func direntNamlen(buf []byte) (uint64, bool) {
2024-02-18 10:42:21 +00:00
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
2024-02-18 10:42:21 +00:00
}
func Pipe(p []int) (err error) {
2024-02-18 10:42:21 +00:00
return Pipe2(p, 0)
2024-02-18 10:42:21 +00:00
}
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
func Pipe2(p []int, flags int) error {
2024-02-18 10:42:21 +00:00
if len(p) != 2 {
2024-02-18 10:42:21 +00:00
return EINVAL
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
var pp [2]_C_int
2024-02-18 10:42:21 +00:00
err := pipe2(&pp, flags)
2024-02-18 10:42:21 +00:00
if err == nil {
2024-02-18 10:42:21 +00:00
p[0] = int(pp[0])
2024-02-18 10:42:21 +00:00
p[1] = int(pp[1])
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
2024-02-18 10:42:21 +00:00
var value IPMreqn
2024-02-18 10:42:21 +00:00
vallen := _Socklen(SizeofIPMreqn)
2024-02-18 10:42:21 +00:00
errno := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
2024-02-18 10:42:21 +00:00
return &value, errno
2024-02-18 10:42:21 +00:00
}
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
2024-02-18 10:42:21 +00:00
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
2024-02-18 10:42:21 +00:00
}
// GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct.
2024-02-18 10:42:21 +00:00
// The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively.
2024-02-18 10:42:21 +00:00
func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
2024-02-18 10:42:21 +00:00
x := new(Xucred)
2024-02-18 10:42:21 +00:00
vallen := _Socklen(SizeofXucred)
2024-02-18 10:42:21 +00:00
err := getsockopt(fd, level, opt, unsafe.Pointer(x), &vallen)
2024-02-18 10:42:21 +00:00
return x, err
2024-02-18 10:42:21 +00:00
}
func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
2024-02-18 10:42:21 +00:00
var rsa RawSockaddrAny
2024-02-18 10:42:21 +00:00
var len _Socklen = SizeofSockaddrAny
2024-02-18 10:42:21 +00:00
nfd, err = accept4(fd, &rsa, &len, flags)
2024-02-18 10:42:21 +00:00
if err != nil {
2024-02-18 10:42:21 +00:00
return
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
if len > SizeofSockaddrAny {
2024-02-18 10:42:21 +00:00
panic("RawSockaddrAny too small")
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
sa, err = anyToSockaddr(fd, &rsa)
2024-02-18 10:42:21 +00:00
if err != nil {
2024-02-18 10:42:21 +00:00
Close(nfd)
2024-02-18 10:42:21 +00:00
nfd = 0
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return
2024-02-18 10:42:21 +00:00
}
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
2024-02-18 10:42:21 +00:00
var (
_p0 unsafe.Pointer
2024-02-18 10:42:21 +00:00
bufsize uintptr
)
2024-02-18 10:42:21 +00:00
if len(buf) > 0 {
2024-02-18 10:42:21 +00:00
_p0 = unsafe.Pointer(&buf[0])
2024-02-18 10:42:21 +00:00
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
2024-02-18 10:42:21 +00:00
n = int(r0)
2024-02-18 10:42:21 +00:00
if e1 != 0 {
2024-02-18 10:42:21 +00:00
err = e1
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return
2024-02-18 10:42:21 +00:00
}
//sys ioctl(fd int, req uint, arg uintptr) (err error) = SYS_IOCTL
2024-02-18 10:42:21 +00:00
//sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = SYS_IOCTL
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
func Uname(uname *Utsname) error {
2024-02-18 10:42:21 +00:00
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
2024-02-18 10:42:21 +00:00
n := unsafe.Sizeof(uname.Sysname)
2024-05-14 13:07:09 +00:00
// Suppress ENOMEM errors to be compatible with the C library __xuname() implementation.
2024-05-14 13:07:09 +00:00
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
2024-02-18 10:42:21 +00:00
n = unsafe.Sizeof(uname.Nodename)
2024-05-14 13:07:09 +00:00
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
2024-02-18 10:42:21 +00:00
n = unsafe.Sizeof(uname.Release)
2024-05-14 13:07:09 +00:00
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
mib = []_C_int{CTL_KERN, KERN_VERSION}
2024-02-18 10:42:21 +00:00
n = unsafe.Sizeof(uname.Version)
2024-05-14 13:07:09 +00:00
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
// The version might have newlines or tabs in it, convert them to
2024-02-18 10:42:21 +00:00
// spaces.
2024-02-18 10:42:21 +00:00
for i, b := range uname.Version {
2024-02-18 10:42:21 +00:00
if b == '\n' || b == '\t' {
2024-02-18 10:42:21 +00:00
if i == len(uname.Version)-1 {
2024-02-18 10:42:21 +00:00
uname.Version[i] = 0
2024-02-18 10:42:21 +00:00
} else {
2024-02-18 10:42:21 +00:00
uname.Version[i] = ' '
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
}
mib = []_C_int{CTL_HW, HW_MACHINE}
2024-02-18 10:42:21 +00:00
n = unsafe.Sizeof(uname.Machine)
2024-05-14 13:07:09 +00:00
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
return nil
2024-02-18 10:42:21 +00:00
}
func Stat(path string, st *Stat_t) (err error) {
2024-02-18 10:42:21 +00:00
return Fstatat(AT_FDCWD, path, st, 0)
2024-02-18 10:42:21 +00:00
}
func Lstat(path string, st *Stat_t) (err error) {
2024-02-18 10:42:21 +00:00
return Fstatat(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW)
2024-02-18 10:42:21 +00:00
}
func Getdents(fd int, buf []byte) (n int, err error) {
2024-02-18 10:42:21 +00:00
return Getdirentries(fd, buf, nil)
2024-02-18 10:42:21 +00:00
}
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
2024-02-18 10:42:21 +00:00
if basep == nil || unsafe.Sizeof(*basep) == 8 {
2024-02-18 10:42:21 +00:00
return getdirentries(fd, buf, (*uint64)(unsafe.Pointer(basep)))
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
// The syscall needs a 64-bit base. On 32-bit machines
2024-02-18 10:42:21 +00:00
// we can't just use the basep passed in. See #32498.
2024-02-18 10:42:21 +00:00
var base uint64 = uint64(*basep)
2024-02-18 10:42:21 +00:00
n, err = getdirentries(fd, buf, &base)
2024-02-18 10:42:21 +00:00
*basep = uintptr(base)
2024-02-18 10:42:21 +00:00
if base>>32 != 0 {
2024-02-18 10:42:21 +00:00
// We can't stuff the base back into a uintptr, so any
2024-02-18 10:42:21 +00:00
// future calls would be suspect. Generate an error.
2024-02-18 10:42:21 +00:00
// EIO is allowed by getdirentries.
2024-02-18 10:42:21 +00:00
err = EIO
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return
2024-02-18 10:42:21 +00:00
}
func Mknod(path string, mode uint32, dev uint64) (err error) {
2024-02-18 10:42:21 +00:00
return Mknodat(AT_FDCWD, path, mode, dev)
2024-02-18 10:42:21 +00:00
}
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
2024-02-18 10:42:21 +00:00
if raceenabled {
2024-02-18 10:42:21 +00:00
raceReleaseMerge(unsafe.Pointer(&ioSync))
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
return sendfile(outfd, infd, offset, count)
2024-02-18 10:42:21 +00:00
}
//sys ptrace(request int, pid int, addr uintptr, data int) (err error)
2024-02-18 10:42:21 +00:00
//sys ptracePtr(request int, pid int, addr unsafe.Pointer, data int) (err error) = SYS_PTRACE
func PtraceAttach(pid int) (err error) {
2024-02-18 10:42:21 +00:00
return ptrace(PT_ATTACH, pid, 0, 0)
2024-02-18 10:42:21 +00:00
}
func PtraceCont(pid int, signal int) (err error) {
2024-02-18 10:42:21 +00:00
return ptrace(PT_CONTINUE, pid, 1, signal)
2024-02-18 10:42:21 +00:00
}
func PtraceDetach(pid int) (err error) {
2024-02-18 10:42:21 +00:00
return ptrace(PT_DETACH, pid, 1, 0)
2024-02-18 10:42:21 +00:00
}
func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) {
2024-02-18 10:42:21 +00:00
return ptracePtr(PT_GETFPREGS, pid, unsafe.Pointer(fpregsout), 0)
2024-02-18 10:42:21 +00:00
}
func PtraceGetRegs(pid int, regsout *Reg) (err error) {
2024-02-18 10:42:21 +00:00
return ptracePtr(PT_GETREGS, pid, unsafe.Pointer(regsout), 0)
2024-02-18 10:42:21 +00:00
}
func PtraceIO(req int, pid int, offs uintptr, out []byte, countin int) (count int, err error) {
2024-02-18 10:42:21 +00:00
ioDesc := PtraceIoDesc{
Op: int32(req),
2024-02-18 10:42:21 +00:00
Offs: offs,
}
2024-02-18 10:42:21 +00:00
if countin > 0 {
2024-02-18 10:42:21 +00:00
_ = out[:countin] // check bounds
2024-02-18 10:42:21 +00:00
ioDesc.Addr = &out[0]
2024-02-18 10:42:21 +00:00
} else if out != nil {
2024-02-18 10:42:21 +00:00
ioDesc.Addr = (*byte)(unsafe.Pointer(&_zero))
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
ioDesc.SetLen(countin)
err = ptracePtr(PT_IO, pid, unsafe.Pointer(&ioDesc), 0)
2024-02-18 10:42:21 +00:00
return int(ioDesc.Len), err
2024-02-18 10:42:21 +00:00
}
func PtraceLwpEvents(pid int, enable int) (err error) {
2024-02-18 10:42:21 +00:00
return ptrace(PT_LWP_EVENTS, pid, 0, enable)
2024-02-18 10:42:21 +00:00
}
func PtraceLwpInfo(pid int, info *PtraceLwpInfoStruct) (err error) {
2024-02-18 10:42:21 +00:00
return ptracePtr(PT_LWPINFO, pid, unsafe.Pointer(info), int(unsafe.Sizeof(*info)))
2024-02-18 10:42:21 +00:00
}
func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {
2024-02-18 10:42:21 +00:00
return PtraceIO(PIOD_READ_D, pid, addr, out, SizeofLong)
2024-02-18 10:42:21 +00:00
}
func PtracePeekText(pid int, addr uintptr, out []byte) (count int, err error) {
2024-02-18 10:42:21 +00:00
return PtraceIO(PIOD_READ_I, pid, addr, out, SizeofLong)
2024-02-18 10:42:21 +00:00
}
func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
2024-02-18 10:42:21 +00:00
return PtraceIO(PIOD_WRITE_D, pid, addr, data, SizeofLong)
2024-02-18 10:42:21 +00:00
}
func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {
2024-02-18 10:42:21 +00:00
return PtraceIO(PIOD_WRITE_I, pid, addr, data, SizeofLong)
2024-02-18 10:42:21 +00:00
}
func PtraceSetRegs(pid int, regs *Reg) (err error) {
2024-02-18 10:42:21 +00:00
return ptracePtr(PT_SETREGS, pid, unsafe.Pointer(regs), 0)
2024-02-18 10:42:21 +00:00
}
func PtraceSingleStep(pid int) (err error) {
2024-02-18 10:42:21 +00:00
return ptrace(PT_STEP, pid, 1, 0)
2024-02-18 10:42:21 +00:00
}
func Dup3(oldfd, newfd, flags int) error {
2024-02-18 10:42:21 +00:00
if oldfd == newfd || flags&^O_CLOEXEC != 0 {
2024-02-18 10:42:21 +00:00
return EINVAL
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
how := F_DUP2FD
2024-02-18 10:42:21 +00:00
if flags&O_CLOEXEC != 0 {
2024-02-18 10:42:21 +00:00
how = F_DUP2FD_CLOEXEC
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
_, err := fcntl(oldfd, how, newfd)
2024-02-18 10:42:21 +00:00
return err
2024-02-18 10:42:21 +00:00
}
/*
2024-02-18 10:42:21 +00:00
* Exposed directly
2024-02-18 10:42:21 +00:00
*/
2024-02-18 10:42:21 +00:00
//sys Access(path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
2024-02-18 10:42:21 +00:00
//sys CapEnter() (err error)
2024-02-18 10:42:21 +00:00
//sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
2024-02-18 10:42:21 +00:00
//sys capRightsLimit(fd int, rightsp *CapRights) (err error)
2024-02-18 10:42:21 +00:00
//sys Chdir(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys Chflags(path string, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Chmod(path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Chown(path string, uid int, gid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Chroot(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys ClockGettime(clockid int32, time *Timespec) (err error)
2024-02-18 10:42:21 +00:00
//sys Close(fd int) (err error)
2024-02-18 10:42:21 +00:00
//sys Dup(fd int) (nfd int, err error)
2024-02-18 10:42:21 +00:00
//sys Dup2(from int, to int) (err error)
2024-02-18 10:42:21 +00:00
//sys Exit(code int)
2024-02-18 10:42:21 +00:00
//sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
2024-02-18 10:42:21 +00:00
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
2024-02-18 10:42:21 +00:00
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
2024-02-18 10:42:21 +00:00
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchdir(fd int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchflags(fd int, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchmod(fd int, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchown(fd int, uid int, gid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Flock(fd int, how int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fpathconf(fd int, name int) (val int, err error)
2024-02-18 10:42:21 +00:00
//sys Fstat(fd int, stat *Stat_t) (err error)
2024-02-18 10:42:21 +00:00
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
2024-02-18 10:42:21 +00:00
//sys Fsync(fd int) (err error)
2024-02-18 10:42:21 +00:00
//sys Ftruncate(fd int, length int64) (err error)
2024-02-18 10:42:21 +00:00
//sys getdirentries(fd int, buf []byte, basep *uint64) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys Getdtablesize() (size int)
2024-02-18 10:42:21 +00:00
//sysnb Getegid() (egid int)
2024-02-18 10:42:21 +00:00
//sysnb Geteuid() (uid int)
2024-02-18 10:42:21 +00:00
//sysnb Getgid() (gid int)
2024-02-18 10:42:21 +00:00
//sysnb Getpgid(pid int) (pgid int, err error)
2024-02-18 10:42:21 +00:00
//sysnb Getpgrp() (pgrp int)
2024-02-18 10:42:21 +00:00
//sysnb Getpid() (pid int)
2024-02-18 10:42:21 +00:00
//sysnb Getppid() (ppid int)
2024-02-18 10:42:21 +00:00
//sys Getpriority(which int, who int) (prio int, err error)
2024-02-18 10:42:21 +00:00
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Getrusage(who int, rusage *Rusage) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Getsid(pid int) (sid int, err error)
2024-02-18 10:42:21 +00:00
//sysnb Gettimeofday(tv *Timeval) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Getuid() (uid int)
2024-02-18 10:42:21 +00:00
//sys Issetugid() (tainted bool)
2024-02-18 10:42:21 +00:00
//sys Kill(pid int, signum syscall.Signal) (err error)
2024-02-18 10:42:21 +00:00
//sys Kqueue() (fd int, err error)
2024-02-18 10:42:21 +00:00
//sys Lchown(path string, uid int, gid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Link(path string, link string) (err error)
2024-02-18 10:42:21 +00:00
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Listen(s int, backlog int) (err error)
2024-02-18 10:42:21 +00:00
//sys Mkdir(path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Mkfifo(path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Mknodat(fd int, path string, mode uint32, dev uint64) (err error)
2024-02-18 10:42:21 +00:00
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
2024-02-18 10:42:21 +00:00
//sys Open(path string, mode int, perm uint32) (fd int, err error)
2024-02-18 10:42:21 +00:00
//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
2024-02-18 10:42:21 +00:00
//sys Pathconf(path string, name int) (val int, err error)
2024-02-18 10:42:21 +00:00
//sys pread(fd int, p []byte, offset int64) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys read(fd int, p []byte) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys Readlink(path string, buf []byte) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys Rename(from string, to string) (err error)
2024-02-18 10:42:21 +00:00
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
2024-02-18 10:42:21 +00:00
//sys Revoke(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys Rmdir(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
2024-02-18 10:42:21 +00:00
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
2024-02-18 10:42:21 +00:00
//sysnb Setegid(egid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Seteuid(euid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setgid(gid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Setlogin(name string) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setpgid(pid int, pgid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Setpriority(which int, who int, prio int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setregid(rgid int, egid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setreuid(ruid int, euid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setsid() (pid int, err error)
2024-02-18 10:42:21 +00:00
//sysnb Settimeofday(tp *Timeval) (err error)
2024-02-18 10:42:21 +00:00
//sysnb Setuid(uid int) (err error)
2024-02-18 10:42:21 +00:00
//sys Statfs(path string, stat *Statfs_t) (err error)
2024-02-18 10:42:21 +00:00
//sys Symlink(path string, link string) (err error)
2024-02-18 10:42:21 +00:00
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
2024-02-18 10:42:21 +00:00
//sys Sync() (err error)
2024-02-18 10:42:21 +00:00
//sys Truncate(path string, length int64) (err error)
2024-02-18 10:42:21 +00:00
//sys Umask(newmask int) (oldmask int)
2024-02-18 10:42:21 +00:00
//sys Undelete(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys Unlink(path string) (err error)
2024-02-18 10:42:21 +00:00
//sys Unlinkat(dirfd int, path string, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys Unmount(path string, flags int) (err error)
2024-02-18 10:42:21 +00:00
//sys write(fd int, p []byte) (n int, err error)
2024-02-18 10:42:21 +00:00
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
2024-02-18 10:42:21 +00:00
//sys munmap(addr uintptr, length uintptr) (err error)
2024-02-18 10:42:21 +00:00
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
2024-02-18 10:42:21 +00:00
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)