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

649 lines
13 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.
// NetBSD 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 (
"syscall"
"unsafe"
)
// 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 [12]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
}
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {
2024-02-18 10:42:21 +00:00
var olen uintptr
// Get a list of all sysctl nodes below the given MIB by performing
2024-02-18 10:42:21 +00:00
// a sysctl for the given MIB with CTL_QUERY appended.
2024-02-18 10:42:21 +00:00
mib = append(mib, CTL_QUERY)
2024-02-18 10:42:21 +00:00
qnode := Sysctlnode{Flags: SYSCTL_VERS_1}
2024-02-18 10:42:21 +00:00
qp := (*byte)(unsafe.Pointer(&qnode))
2024-02-18 10:42:21 +00:00
sz := unsafe.Sizeof(qnode)
2024-02-18 10:42:21 +00:00
if err = sysctl(mib, nil, &olen, qp, sz); err != nil {
2024-02-18 10:42:21 +00:00
return nil, err
2024-02-18 10:42:21 +00:00
}
// Now that we know the size, get the actual nodes.
2024-02-18 10:42:21 +00:00
nodes = make([]Sysctlnode, olen/sz)
2024-02-18 10:42:21 +00:00
np := (*byte)(unsafe.Pointer(&nodes[0]))
2024-02-18 10:42:21 +00:00
if err = sysctl(mib, np, &olen, qp, sz); err != nil {
2024-02-18 10:42:21 +00:00
return nil, err
2024-02-18 10:42:21 +00:00
}
return nodes, nil
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
// Split name into components.
2024-02-18 10:42:21 +00:00
var parts []string
2024-02-18 10:42:21 +00:00
last := 0
2024-02-18 10:42:21 +00:00
for i := 0; i < len(name); i++ {
2024-02-18 10:42:21 +00:00
if name[i] == '.' {
2024-02-18 10:42:21 +00:00
parts = append(parts, name[last:i])
2024-02-18 10:42:21 +00:00
last = i + 1
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
parts = append(parts, name[last:])
// Discover the nodes and construct the MIB OID.
2024-02-18 10:42:21 +00:00
for partno, part := range parts {
2024-02-18 10:42:21 +00:00
nodes, err := sysctlNodes(mib)
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
}
2024-02-18 10:42:21 +00:00
for _, node := range nodes {
2024-02-18 10:42:21 +00:00
n := make([]byte, 0)
2024-02-18 10:42:21 +00:00
for i := range node.Name {
2024-02-18 10:42:21 +00:00
if node.Name[i] != 0 {
2024-02-18 10:42:21 +00:00
n = append(n, byte(node.Name[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
if string(n) == part {
2024-02-18 10:42:21 +00:00
mib = append(mib, _C_int(node.Num))
2024-02-18 10:42:21 +00:00
break
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
if len(mib) != partno+1 {
2024-02-18 10:42:21 +00:00
return nil, EINVAL
2024-02-18 10:42:21 +00:00
}
2024-02-18 10:42:21 +00:00
}
return mib, 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 SysctlUvmexp(name string) (*Uvmexp, error) {
2024-02-18 10:42:21 +00:00
mib, err := sysctlmib(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
}
n := uintptr(SizeofUvmexp)
2024-02-18 10:42:21 +00:00
var u Uvmexp
2024-02-18 10:42:21 +00:00
if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); 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 &u, nil
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
}
//sys Getdents(fd int, buf []byte) (n int, err error)
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
2024-02-18 10:42:21 +00:00
n, err = Getdents(fd, buf)
2024-02-18 10:42:21 +00:00
if err != nil || basep == nil {
2024-02-18 10:42:21 +00:00
return
2024-02-18 10:42:21 +00:00
}
var off int64
2024-02-18 10:42:21 +00:00
off, err = Seek(fd, 0, 1 /* SEEK_CUR */)
2024-02-18 10:42:21 +00:00
if err != nil {
2024-02-18 10:42:21 +00:00
*basep = ^uintptr(0)
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
*basep = uintptr(off)
2024-02-18 10:42:21 +00:00
if unsafe.Sizeof(*basep) == 8 {
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 off>>32 != 0 {
2024-02-18 10:42:21 +00:00
// We can't stuff the offset 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
}
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
// TODO
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
return -1, ENOSYS
2024-02-18 10:42:21 +00:00
}
//sys ioctl(fd int, req uint, arg uintptr) (err error)
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 IoctlGetPtmget(fd int, req uint) (*Ptmget, error) {
2024-02-18 10:42:21 +00:00
var value Ptmget
2024-02-18 10:42:21 +00:00
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
2024-02-18 10:42:21 +00:00
return &value, err
2024-02-18 10:42:21 +00:00
}
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-02-18 10:42:21 +00:00
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
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-02-18 10:42:21 +00:00
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
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-02-18 10:42:21 +00:00
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
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-02-18 10:42:21 +00:00
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
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-02-18 10:42:21 +00:00
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
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 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
}
func Fstatvfs(fd int, buf *Statvfs_t) (err error) {
2024-02-18 10:42:21 +00:00
return Fstatvfs1(fd, buf, ST_WAIT)
2024-02-18 10:42:21 +00:00
}
func Statvfs(path string, buf *Statvfs_t) (err error) {
2024-02-18 10:42:21 +00:00
return Statvfs1(path, buf, ST_WAIT)
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 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 Dup3(from int, to int, flags 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 Faccessat(dirfd int, path string, mode uint32, flags 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 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 Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1
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
//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 Lstat(path string, stat *Stat_t) (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 Mkfifoat(dirfd int, path string, mode uint32) (err error)
2024-02-18 10:42:21 +00:00
//sys Mknod(path string, mode uint32, dev int) (err error)
2024-02-18 10:42:21 +00:00
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (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(dirfd 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
//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 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 Stat(path string, stat *Stat_t) (err error)
2024-02-18 10:42:21 +00:00
//sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1
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 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 utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
const (
mremapFixed = MAP_FIXED
2024-02-18 10:42:21 +00:00
mremapDontunmap = 0
mremapMaymove = 0
2024-02-18 10:42:21 +00:00
)
//sys mremapNetBSD(oldp uintptr, oldsize uintptr, newp uintptr, newsize uintptr, flags int) (xaddr uintptr, err error) = SYS_MREMAP
func mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (uintptr, error) {
2024-02-18 10:42:21 +00:00
return mremapNetBSD(oldaddr, oldlength, newaddr, newlength, flags)
2024-02-18 10:42:21 +00:00
}