2017-02-09 10:44:26 -05:00
|
|
|
// mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go
|
2018-06-14 11:49:42 +02:00
|
|
|
// Code generated by the command above; DO NOT EDIT.
|
2012-10-12 16:26:42 +08:00
|
|
|
|
2017-02-09 10:44:26 -05:00
|
|
|
// +build freebsd,arm
|
2015-05-14 21:01:52 -04:00
|
|
|
|
2012-10-12 16:26:42 +08:00
|
|
|
package syscall
|
|
|
|
|
|
|
|
|
|
import "unsafe"
|
|
|
|
|
|
|
|
|
|
// 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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-03-29 09:28:40 +09:00
|
|
|
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)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|
|
|
|
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
|
|
|
|
val = int(r0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2017-03-21 10:23:08 -07:00
|
|
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
|
|
|
|
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 08:02:16 -07:00
|
|
|
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
nfd = int(r0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 08:02:16 -07:00
|
|
|
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Fchdir(fd int) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func Fchflags(fd int, flags int) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Flock(fd int, how int) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func fstat(fd int, stat *stat_freebsd11_t) (err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +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
|
|
|
|
|
|
2018-11-01 08:02:46 +00:00
|
|
|
func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) {
|
|
|
|
|
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
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +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) {
|
2012-10-12 16:26:42 +08:00
|
|
|
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +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
|
|
|
|
|
|
2012-10-12 16:26:42 +08:00
|
|
|
func Fsync(fd int) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Ftruncate(fd int, length int64) (err error) {
|
2014-02-07 10:23:26 +09:00
|
|
|
_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
2012-10-12 16:26:42 +08:00
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
|
if len(buf) > 0 {
|
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
|
} else {
|
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
|
}
|
|
|
|
|
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
|
|
|
n = int(r0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
|
|
|
var _p0 unsafe.Pointer
|
|
|
|
|
if len(buf) > 0 {
|
|
|
|
|
_p0 = unsafe.Pointer(&buf[0])
|
|
|
|
|
} else {
|
|
|
|
|
_p0 = unsafe.Pointer(&_zero)
|
|
|
|
|
}
|
|
|
|
|
r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 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
|
|
|
|
|
|
2012-10-12 16:26:42 +08:00
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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
|
|
|
|
|
|
|
|
|
|
func Kill(pid int, signum Signal) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Listen(s int, backlog int) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func lstat(path string, stat *stat_freebsd11_t) (err error) {
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func mknod(path string, mode uint32, dev int) (err error) {
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
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
|
|
|
|
|
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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)
|
|
|
|
|
}
|
2014-02-07 10:23:26 +09:00
|
|
|
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
|
2012-10-12 16:26:42 +08:00
|
|
|
n = int(r0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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)
|
|
|
|
|
}
|
2014-02-07 10:23:26 +09:00
|
|
|
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
|
2012-10-12 16:26:42 +08:00
|
|
|
n = int(r0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2014-01-22 10:35:41 -08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2012-10-12 16:26:42 +08:00
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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) {
|
2014-02-07 10:23:26 +09:00
|
|
|
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
newoffset = int64(int64(r1)<<32 | int64(r0))
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
|
|
|
|
|
_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func stat(path string, stat *stat_freebsd11_t) (err error) {
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +03:00
|
|
|
func statfs(path string, stat *statfs_freebsd11_t) (err error) {
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
syscall: FreeBSD 12 ino64 support
This is similar to CL 136816 for x/sys/unix, changing the FreeBSD ABI to use 64-bit inodes in
Stat_t, Statfs_t, and Dirent types.
The changes are forward compatible, that is FreeBSD 10.x, 11.x continue to use their current sysnum numbers.
The affected types are converted to the new layout (with some overhead).
Thus the same statically linked binary should work using the native sysnums (without any conversion) on FreeBSD 12.
Breaking API changes in package syscall are:
Mknod takes a uint64 (C dev_t) instead of int.
Stat_t: Dev, Ino, Nlink, Rdev, Gen became uint64.
Atimespec, Mtimespec, Ctimespec, Birthtimespec renamed to Atim, Mtim, Ctim, Birthtim respectively.
Statfs_t: Mntonname and Mntfromname changed from [88]int8 to [1024]int8 arrays.
Dirent: Fileno became uint64, Namlen uint16 and an additional field Off int64 (currently unused) was added.
The following commands were run to generate ztypes_* and zsyscall_* on FreeBSD-12.0-ALPHA6 systems (GOARCH=386 were run on the same amd64 host):
GOOS=freebsd GOARCH=amd64 ./mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go |gofmt >zsyscall_freebsd_amd64.go
GOOS=freebsd GOARCH=amd64 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=amd64 go run mkpost.go >ztypes_freebsd_amd64.go
GOOS=freebsd GOARCH=386 ./mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go |gofmt >zsyscall_freebsd_386.go
GOOS=freebsd GOARCH=386 go tool cgo -godefs types_freebsd.go | GOOS=freebsd GOARCH=386 go run mkpost.go >ztypes_freebsd_386.go
GOOS=freebsd GOARCH=arm ./mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go |gofmt >zsyscall_freebsd_arm.go
GOOS=freebsd GOARCH=arm go tool cgo -godefs -- -fsigned-char types_freebsd.go | GOOS=freebsd GOARCH=arm go run mkpost.go >ztypes_freebsd_arm.go
The Kevent struct was changed to use the FREEBSD_COMPAT11 version always (requiring the COMPAT_FREEBSD11 kernel option FreeBSD-12, this is the default).
The definitions of ifData were not updated, their functionality in has have been replaced by vendored golang.org/x/net/route.
freebsdVersion initialization was dropped from init() in favor of a sync.Once based wrapper - supportsABI().
Updates #22448.
Change-Id: I359b756e2849c036d7ed7f75dbd6ec836e0b90b4
Reviewed-on: https://go-review.googlesource.com/c/138595
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-09-29 18:17:29 +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
|
|
|
|
|
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
func Sync() (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
|
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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
|
|
|
|
|
}
|
2014-02-07 10:23:26 +09:00
|
|
|
_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
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)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
2014-01-22 10:35:41 -08:00
|
|
|
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
|
|
|
n = int(r0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
2014-02-07 10:23:26 +09:00
|
|
|
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
|
2014-01-22 10:35:41 -08:00
|
|
|
ret = uintptr(r0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2014-01-22 10:35:41 -08:00
|
|
|
func munmap(addr uintptr, length uintptr) (err error) {
|
|
|
|
|
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
|
2012-10-12 16:26:42 +08:00
|
|
|
if e1 != 0 {
|
2015-03-27 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08: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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2012-10-12 16:26:42 +08:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
2014-03-04 09:27:48 +09:00
|
|
|
|
|
|
|
|
// 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 10:08:19 +01:00
|
|
|
err = errnoErr(e1)
|
2014-03-04 09:27:48 +09:00
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
2017-08-11 16:49:01 +02:00
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
2017-08-14 19:05:56 +03:00
|
|
|
func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) {
|
2017-08-11 16:49:01 +02:00
|
|
|
var _p0 *byte
|
|
|
|
|
_p0, err = BytePtrFromString(path)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return
|
|
|
|
|
}
|
2017-08-14 19:05:56 +03:00
|
|
|
_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0)
|
2017-08-11 16:49:01 +02:00
|
|
|
if e1 != 0 {
|
|
|
|
|
err = errnoErr(e1)
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|
2017-12-14 11:59:33 +01:00
|
|
|
|
|
|
|
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|