2018-11-19 15:01:13 +03:00
|
|
|
// go run mksyscall.go -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go
|
2017-06-29 23:26:00 +03:00
|
|
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
2014-08-12 01:48:46 +04:00
|
|
|
|
2021-02-20 06:57:36 +03:00
|
|
|
//go:build freebsd && amd64
|
2017-02-10 17:16:29 +03:00
|
|
|
// +build freebsd,amd64
|
2015-05-17 04:52:17 +03:00
|
|
|
|
2014-08-12 02:58:26 +04:00
|
|
|
package unix
|
2014-08-12 01:48:46 +04:00
|
|
|
|
2014-11-10 14:48:04 +03:00
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ syscall.Errno
|
2014-08-12 01:48:46 +04:00
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
|
|
|
|
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func setgroups(ngid int, gid *_Gid_t) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
|
|
|
|
wpid = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
|
|
fd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func socket(domain int, typ int, proto int) (fd int, err error) {
|
|
|
|
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
|
|
|
|
fd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
|
|
|
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
|
|
|
|
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Shutdown(s int, how int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
|
|
|
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func utimes(path string, timeval *[2]Timeval) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-10-30 13:04:47 +03:00
|
|
|
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-08-16 18:16:36 +03:00
|
|
|
func Madvise(b []byte, behav int) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(b) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&b[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Mlock(b []byte) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(b) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&b[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Mlockall(flags int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Mprotect(b []byte, prot int) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(b) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&b[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Msync(b []byte, flags int) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(b) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&b[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Munlock(b []byte) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(b) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&b[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Munlockall() (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2019-09-23 22:22:06 +03:00
|
|
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
2019-06-21 07:51:29 +03:00
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-12-13 14:26:59 +03:00
|
|
|
func Getcwd(buf []byte) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-08-02 15:44:58 +03:00
|
|
|
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2020-03-17 13:29:44 +03:00
|
|
|
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(mib) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&mib[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2019-09-23 22:22:06 +03:00
|
|
|
func ptrace(request int, pid int, addr uintptr, data int) (err error) {
|
|
|
|
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Access(path string, mode uint32) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-06-29 23:26:00 +03:00
|
|
|
func CapEnter() (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func capRightsGet(version int, fd int, rightsp *CapRights) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp)))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func capRightsLimit(fd int, rightsp *CapRights) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Chdir(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Chflags(path string, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Chmod(path string, mode uint32) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Chown(path string, uid int, gid int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Chroot(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Close(fd int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Dup(fd int) (nfd int, err error) {
|
2015-03-26 20:28:08 +03:00
|
|
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
|
2014-08-12 01:48:46 +04:00
|
|
|
nfd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Dup2(from int, to int) (err error) {
|
2015-03-26 20:28:08 +03:00
|
|
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
2014-08-12 01:48:46 +04:00
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Exit(code int) {
|
|
|
|
Syscall(SYS_EXIT, uintptr(code), 0, 0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-10-08 18:29:25 +04:00
|
|
|
func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(file)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(file)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(file)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(file)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(attrname)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
|
|
|
|
ret = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-10-08 18:29:25 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2015-03-26 07:58:20 +03:00
|
|
|
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
|
|
|
|
_, _, e1 := Syscall6(SYS_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 19:56:46 +03:00
|
|
|
err = errnoErr(e1)
|
2015-03-26 07:58:20 +03:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Fchdir(fd int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Fchflags(fd int, flags int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Fchmod(fd int, mode uint32) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Fchown(fd int, uid int, gid int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Flock(fd int, how int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Fpathconf(fd int, name int) (val int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
|
|
|
|
val = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func fstat(fd int, stat *stat_freebsd11_t) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func fstat_freebsd12(fd int, stat *Stat_t) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) {
|
2018-03-14 16:04:10 +03:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Fsync(fd int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Ftruncate(fd int, length int64) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
2017-11-29 11:33:14 +03:00
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
2017-11-29 11:33:14 +03:00
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2019-06-10 19:23:19 +03:00
|
|
|
func getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
2014-08-12 01:48:46 +04:00
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getdtablesize() (size int) {
|
|
|
|
r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
|
|
|
|
size = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getegid() (egid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
|
|
|
egid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Geteuid() (uid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
|
|
|
uid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getgid() (gid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
|
|
|
gid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getpgid(pid int) (pgid int, err error) {
|
|
|
|
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
|
|
|
|
pgid = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getpgrp() (pgrp int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
|
|
|
pgrp = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getpid() (pid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
|
|
|
pid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getppid() (ppid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
|
|
|
ppid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getpriority(which int, who int) (prio int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
|
|
|
|
prio = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getrlimit(which int, lim *Rlimit) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getrusage(who int, rusage *Rusage) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getsid(pid int) (sid int, err error) {
|
|
|
|
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
|
|
|
|
sid = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Gettimeofday(tv *Timeval) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Getuid() (uid int) {
|
|
|
|
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
|
|
|
uid = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Issetugid() (tainted bool) {
|
|
|
|
r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
|
|
|
|
tainted = bool(r0 != 0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-15 20:57:24 +04:00
|
|
|
func Kill(pid int, signum syscall.Signal) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Kqueue() (fd int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
|
|
|
|
fd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Lchown(path string, uid int, gid int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Link(path string, link string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Listen(s int, backlog int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func lstat(path string, stat *stat_freebsd11_t) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Mkdir(path string, mode uint32) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Mkfifo(path string, mode uint32) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func mknod(path string, mode uint32, dev int) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
2014-12-21 08:16:04 +03:00
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func mknodat(fd int, path string, mode uint32, dev int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
|
|
|
|
fd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-06-29 23:26:00 +03:00
|
|
|
func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
|
|
|
fd = int(r0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Pathconf(path string, name int) (val int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
|
|
|
|
val = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Pread(fd int, p []byte, offset int64) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func read(fd int, p []byte) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Readlink(path string, buf []byte) (n int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p1 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p1 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 unsafe.Pointer
|
|
|
|
if len(buf) > 0 {
|
|
|
|
_p1 = unsafe.Pointer(&buf[0])
|
|
|
|
} else {
|
|
|
|
_p1 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Rename(from string, to string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(from)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(to)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(from)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(to)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Revoke(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Rmdir(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
|
|
|
|
newoffset = int64(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2019-09-23 22:22:06 +03:00
|
|
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
|
|
|
n = int(r0)
|
2014-08-12 01:48:46 +04:00
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setegid(egid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Seteuid(euid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setgid(gid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setlogin(name string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(name)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setpgid(pid int, pgid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setpriority(which int, who int, prio int) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setregid(rgid int, egid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setreuid(ruid int, euid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setresgid(rgid int, egid int, sgid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setresuid(ruid int, euid int, suid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setrlimit(which int, lim *Rlimit) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setsid() (pid int, err error) {
|
|
|
|
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
|
|
|
|
pid = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Settimeofday(tp *Timeval) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Setuid(uid int) (err error) {
|
|
|
|
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func stat(path string, stat *stat_freebsd11_t) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func statfs(path string, stat *statfs_freebsd11_t) (err error) {
|
2014-08-12 01:48:46 +04:00
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
unix: FreeBSD 12 ino64 support
Background:
The 64-bit inode project was merged into the upcoming FreeBSD 12 release.
It changes the ABI for structs holding inodes: stat, statfs, dirent.
New system call numbers were introduced which accept the new struct layouts,
the old ones were marked as COMPAT11.
Their equivalent libc wrappers are using ELF symbol versioning.
The new wrappers have moved from @FBSD_1.0 to @FBSD_1.5.
Backward and forward compatability is achieved by always using the new struct
layouts while converting the old struct instance to the new layout on old kernels.
https://svnweb.freebsd.org/base?view=revision&revision=318736
https://svnweb.freebsd.org/base?view=revision&revision=320278
The same approach is used for Go:
The new Stat_t, Statfs_t and Dirent types hold 64-bit inodes and additional ABI
changes, they are generated from their C definitions in FreeBSD-12 using cgo -godefs.
Each type has an unexported *_freebsd11 counterpart generated the same way.
Previous directly exposed syscalls like Fstat have now a wrapper in place calling
either fstat or fstat_freebsd12 zsyscall wrapper based on the kern.osreldate.
If an old syscall needs to be used, then the returned *_freebsd11 result is converted
to the new layout before returning from the wrapper.
Introduce supportsABI() call to check the kern.osreldate sysctl for the ABI version.
Drop the old struct stat8 definition in favour of the <sys/stat.h> version.
Run the mktypes part of GOOS=freebsd GOARCH={386,amd64,arm} ./mkall.sh
on FreeBSD-12.0-ALPHA6 (r338675), updating all types except Kevent.
Expose Mknodat, both COMPAT11 version (currently missing) and the FreeBSD 12 one.
Some COMPAT11 syscalls have no direct FreeBSD 12 counterpart, in those cases
an *at(AT_FDCWD, ...) is used instead.
Updates golang/go#22448
Change-Id: I87940b88ae358db88103cdcd06f9cafbf4694cfc
Reviewed-on: https://go-review.googlesource.com/c/136816
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Giovanni Bajo <rasky@develer.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2018-09-23 12:28:39 +03:00
|
|
|
func statfs_freebsd12(path string, stat *Statfs_t) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Symlink(path string, link string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(link)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(oldpath)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
var _p1 *byte
|
|
|
|
_p1, err = BytePtrFromString(newpath)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Sync() (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Truncate(path string, length int64) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Umask(newmask int) (oldmask int) {
|
|
|
|
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
|
|
|
|
oldmask = int(r0)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Undelete(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func Unlink(path string) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2017-07-27 17:30:18 +03:00
|
|
|
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
2014-08-12 01:48:46 +04:00
|
|
|
func Unmount(path string, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func write(fd int, p []byte) (n int, err error) {
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
if len(p) > 0 {
|
|
|
|
_p0 = unsafe.Pointer(&p[0])
|
|
|
|
} else {
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
}
|
|
|
|
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
|
|
|
|
ret = uintptr(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func munmap(addr uintptr, length uintptr) (err error) {
|
|
|
|
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
|
|
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
|
|
n = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {
|
|
|
|
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
|
|
|
|
nfd = int(r0)
|
|
|
|
if e1 != 0 {
|
2015-03-27 11:52:00 +03:00
|
|
|
err = errnoErr(e1)
|
2014-08-12 01:48:46 +04:00
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
2017-08-14 13:24:55 +03:00
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
|
|
|
|
var _p0 *byte
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)
|
|
|
|
if e1 != 0 {
|
|
|
|
err = errnoErr(e1)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|