Commit 6faacd22 authored by Russ Cox's avatar Russ Cox

apply gofmt to auto-generated syscall files

R=gri
DELTA=4023  (104 added, 27 deleted, 3892 changed)
OCL=35416
CL=35418
parent a2cf9143
......@@ -126,7 +126,7 @@ linux_arm)
;;
esac
echo "$mkerrors >zerrors_$GOOSARCH.go"
echo "$mksyscall syscall_$GOOS.go syscall_$GOOSARCH.go >zsyscall_$GOOSARCH.go"
echo "$mksysnum >zsysnum_$GOOSARCH.go"
echo "$mktypes types_$GOOS.c >ztypes_$GOOSARCH.go"
echo "$mkerrors |gofmt >zerrors_$GOOSARCH.go"
echo "$mksyscall syscall_$GOOS.go syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"
echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"
echo "$mktypes types_$GOOS.c |gofmt >ztypes_$GOOSARCH.go"
......@@ -152,7 +152,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
95: "EMULTIHOP (Reserved)",
47: "address family not supported by protocol family",
13: "permission denied",
......@@ -257,4 +257,3 @@ var errors = [...]string {
65: "no route to host",
102: "operation not supported on socket",
}
......@@ -152,7 +152,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
95: "EMULTIHOP (Reserved)",
47: "address family not supported by protocol family",
13: "permission denied",
......@@ -257,4 +257,3 @@ var errors = [...]string {
65: "no route to host",
102: "operation not supported on socket",
}
......@@ -182,7 +182,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
72: "multihop attempted",
49: "protocol driver not attached",
97: "address family not supported by protocol",
......@@ -313,4 +313,3 @@ var errors = [...]string {
20: "not a directory",
124: "wrong medium type",
}
......@@ -182,7 +182,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
72: "multihop attempted",
49: "protocol driver not attached",
97: "address family not supported by protocol",
......@@ -313,4 +313,3 @@ var errors = [...]string {
20: "not a directory",
124: "wrong medium type",
}
......@@ -182,7 +182,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
72: "multihop attempted",
49: "protocol driver not attached",
97: "address family not supported by protocol",
......@@ -313,4 +313,3 @@ var errors = [...]string {
76: "name not unique on network",
124: "wrong medium type",
}
......@@ -128,7 +128,7 @@ const (
// Error table
var errors = [...]string {
var errors = [...]string{
EPERM: "operation not permitted",
ENOENT: "no such file or directory",
ESRCH: "no such process",
......
......@@ -86,7 +86,9 @@ func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, time
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
var _p0 *_C_int;
if len(mib) > 0 { _p0 = &mib[0]; }
if len(mib) > 0 {
_p0 = &mib[0];
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(unsafe.Pointer(_p0)), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen));
errno = int(e1);
return;
......@@ -166,7 +168,7 @@ func Exchangedata(path1 string, path2 string, options int) (errno int) {
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT, uintptr(code), 0, 0);
return;
}
......@@ -227,14 +229,16 @@ func Fsync(fd int) (errno int) {
}
func Ftruncate(fd int, length int64) (errno int) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -261,7 +265,9 @@ func Geteuid() (uid int) {
func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
var _p0 *Statfs_t;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags));
n = int(r0);
errno = int(e1);
......@@ -408,8 +414,10 @@ func Pathconf(path string, name int) (val int, errno int) {
func Pread(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -417,8 +425,10 @@ func Pread(fd int, p []byte, offset int64) (n int, errno int) {
func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -426,7 +436,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -435,7 +447,9 @@ func Read(fd int, p []byte) (n int, errno int) {
func Readlink(path string, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -461,7 +475,7 @@ func Rmdir(path string) (errno int) {
}
func Seek(fd int, offset int64, whence int) (newoffset int64, errno int) {
r0, r1, _ := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset >> 32), uintptr(whence), 0, 0);
r0, r1, _ := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0);
newoffset = int64(int64(r1)<<32 | int64(r0));
return;
}
......@@ -576,7 +590,7 @@ func Sync() (errno int) {
}
func Truncate(path string, length int64) (errno int) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
......@@ -607,7 +621,9 @@ func Unmount(path string, flags int) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -635,6 +651,3 @@ func gettimeofday(tp *Timeval) (sec int32, usec int32, errno int) {
errno = int(e1);
return;
}
......@@ -86,7 +86,9 @@ func kevent(kq int, change uintptr, nchange int, event uintptr, nevent int, time
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (errno int) {
var _p0 *_C_int;
if len(mib) > 0 { _p0 = &mib[0]; }
if len(mib) > 0 {
_p0 = &mib[0];
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(unsafe.Pointer(_p0)), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen));
errno = int(e1);
return;
......@@ -166,7 +168,7 @@ func Exchangedata(path1 string, path2 string, options int) (errno int) {
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT, uintptr(code), 0, 0);
return;
}
......@@ -234,7 +236,9 @@ func Ftruncate(fd int, length int64) (errno int) {
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -261,7 +265,9 @@ func Geteuid() (uid int) {
func Getfsstat(buf []Statfs_t, flags int) (n int, errno int) {
var _p0 *Statfs_t;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags));
n = int(r0);
errno = int(e1);
......@@ -408,7 +414,9 @@ func Pathconf(path string, name int) (val int, errno int) {
func Pread(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -417,7 +425,9 @@ func Pread(fd int, p []byte, offset int64) (n int, errno int) {
func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -426,7 +436,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -435,7 +447,9 @@ func Read(fd int, p []byte) (n int, errno int) {
func Readlink(path string, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -608,7 +622,9 @@ func Unmount(path string, flags int) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -636,6 +652,3 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, errno int) {
errno = int(e1);
return;
}
......@@ -25,7 +25,9 @@ func futimesat(dirfd int, path string, times *[2]Timeval) (errno int) {
func Getcwd(buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0);
n = int(r0);
errno = int(e1);
......@@ -124,14 +126,16 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
var _p0 *EpollEvent;
if len(events) > 0 { _p0 = &events[0]; }
if len(events) > 0 {
_p0 = &events[0];
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(unsafe.Pointer(_p0)), uintptr(len(events)), uintptr(msec), 0, 0);
n = int(r0);
errno = int(e1);
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0);
return;
}
......@@ -143,7 +147,7 @@ func Faccessat(dirfd int, path string, mode int, flags int) (errno int) {
}
func Fallocate(fd int, mode int, off int64, len int64) (errno int) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off >> 32), uintptr(len), uintptr(len >> 32));
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32));
errno = int(e1);
return;
}
......@@ -192,14 +196,16 @@ func Fsync(fd int) (errno int) {
}
func Ftruncate(fd int, length int64) (errno int) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
func Getdents(fd int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -275,7 +281,9 @@ func Kill(pid int, sig int) (errno int) {
func Klogctl(typ int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -346,8 +354,10 @@ func PivotRoot(newroot string, putold string) (errno int) {
func Pread(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -355,8 +365,10 @@ func Pread(fd int, p []byte, offset int64) (n int, errno int) {
func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -364,7 +376,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -373,7 +387,9 @@ func Read(fd int, p []byte) (n int, errno int) {
func Readlink(path string, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -400,7 +416,9 @@ func Rmdir(path string) (errno int) {
func Setdomainname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -408,7 +426,9 @@ func Setdomainname(p []byte) (errno int) {
func Sethostname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -456,13 +476,13 @@ func Symlink(oldpath string, newpath string) (errno int) {
return;
}
func Sync() () {
func Sync() {
Syscall(SYS_SYNC, 0, 0, 0);
return;
}
func SyncFileRange(fd int, off int64, n int64, flags int) (errno int) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off >> 32), uintptr(n), uintptr(n >> 32), uintptr(flags));
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags));
errno = int(e1);
return;
}
......@@ -500,7 +520,7 @@ func Times(tms *Tms) (ticks uintptr, errno int) {
}
func Truncate(path string, length int64) (errno int) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
......@@ -549,7 +569,9 @@ func Utime(path string, buf *Utimbuf) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -709,6 +731,3 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
errno = int(e1);
return;
}
......@@ -25,7 +25,9 @@ func futimesat(dirfd int, path string, times *[2]Timeval) (errno int) {
func Getcwd(buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0);
n = int(r0);
errno = int(e1);
......@@ -124,14 +126,16 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
var _p0 *EpollEvent;
if len(events) > 0 { _p0 = &events[0]; }
if len(events) > 0 {
_p0 = &events[0];
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(unsafe.Pointer(_p0)), uintptr(len(events)), uintptr(msec), 0, 0);
n = int(r0);
errno = int(e1);
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0);
return;
}
......@@ -199,7 +203,9 @@ func Ftruncate(fd int, length int64) (errno int) {
func Getdents(fd int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -275,7 +281,9 @@ func Kill(pid int, sig int) (errno int) {
func Klogctl(typ int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -346,7 +354,9 @@ func PivotRoot(newroot string, putold string) (errno int) {
func Pread(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -355,7 +365,9 @@ func Pread(fd int, p []byte, offset int64) (n int, errno int) {
func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), 0, 0);
n = int(r0);
errno = int(e1);
......@@ -364,7 +376,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -373,7 +387,9 @@ func Read(fd int, p []byte) (n int, errno int) {
func Readlink(path string, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -400,7 +416,9 @@ func Rmdir(path string) (errno int) {
func Setdomainname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -408,7 +426,9 @@ func Setdomainname(p []byte) (errno int) {
func Sethostname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -457,7 +477,7 @@ func Symlink(oldpath string, newpath string) (errno int) {
return;
}
func Sync() () {
func Sync() {
Syscall(SYS_SYNC, 0, 0, 0);
return;
}
......@@ -551,7 +571,9 @@ func Utime(path string, buf *Utimbuf) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -774,6 +796,3 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {
errno = int(e1);
return;
}
......@@ -25,7 +25,9 @@ func futimesat(dirfd int, path string, times *[2]Timeval) (errno int) {
func Getcwd(buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), 0);
n = int(r0);
errno = int(e1);
......@@ -124,14 +126,16 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int) {
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int) {
var _p0 *EpollEvent;
if len(events) > 0 { _p0 = &events[0]; }
if len(events) > 0 {
_p0 = &events[0];
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(unsafe.Pointer(_p0)), uintptr(len(events)), uintptr(msec), 0, 0);
n = int(r0);
errno = int(e1);
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0);
return;
}
......@@ -143,7 +147,7 @@ func Faccessat(dirfd int, path string, mode int, flags int) (errno int) {
}
func Fallocate(fd int, mode int, off int64, len int64) (errno int) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off >> 32), uintptr(len), uintptr(len >> 32));
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32));
errno = int(e1);
return;
}
......@@ -192,14 +196,16 @@ func Fsync(fd int) (errno int) {
}
func Ftruncate(fd int, length int64) (errno int) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
func Getdents(fd int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -263,7 +269,9 @@ func Kill(pid int, sig int) (errno int) {
func Klogctl(typ int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -334,8 +342,10 @@ func PivotRoot(newroot string, putold string) (errno int) {
func Pread(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -343,8 +353,10 @@ func Pread(fd int, p []byte, offset int64) (n int, errno int) {
func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset >> 32), 0);
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0);
n = int(r0);
errno = int(e1);
return;
......@@ -352,7 +364,9 @@ func Pwrite(fd int, p []byte, offset int64) (n int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -361,7 +375,9 @@ func Read(fd int, p []byte) (n int, errno int) {
func Readlink(path string, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -388,7 +404,9 @@ func Rmdir(path string) (errno int) {
func Setdomainname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -396,7 +414,9 @@ func Setdomainname(p []byte) (errno int) {
func Sethostname(p []byte) (errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), 0);
errno = int(e1);
return;
......@@ -444,7 +464,7 @@ func Symlink(oldpath string, newpath string) (errno int) {
return;
}
func Sync() () {
func Sync() {
Syscall(SYS_SYNC, 0, 0, 0);
return;
}
......@@ -482,7 +502,7 @@ func Times(tms *Tms) (ticks uintptr, errno int) {
}
func Truncate(path string, length int64) (errno int) {
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length >> 32));
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(length), uintptr(length>>32));
errno = int(e1);
return;
}
......@@ -531,7 +551,9 @@ func Utime(path string, buf *Utimbuf) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -682,7 +704,7 @@ func Lstat(path string, stat *Stat_t) (errno int) {
}
func Seek(fd int, offset int64, whence int) (off int64, errno int) {
r0, r1, _ := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset >> 32), uintptr(whence), 0, 0);
r0, r1, _ := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0);
off = int64(int64(r1)<<32 | int64(r0));
return;
}
......@@ -753,6 +775,3 @@ func Statfs(path string, buf *Statfs_t) (errno int) {
errno = int(e1);
return;
}
......@@ -23,7 +23,7 @@ func Close(fd int) (errno int) {
return;
}
func Exit(code int) () {
func Exit(code int) {
Syscall(SYS_EXIT, uintptr(code), 0, 0);
return;
}
......@@ -36,7 +36,9 @@ func Fstat(fd int, stat *Stat_t) (errno int) {
func Getdents(fd int, buf []byte) (n int, errno int) {
var _p0 *byte;
if len(buf) > 0 { _p0 = &buf[0]; }
if len(buf) > 0 {
_p0 = &buf[0];
}
r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)));
n = int(r0);
errno = int(e1);
......@@ -64,7 +66,9 @@ func Open(path string, mode int, perm int) (fd int, errno int) {
func Read(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -86,7 +90,9 @@ func Stat(path string, stat *Stat_t) (errno int) {
func Write(fd int, p []byte) (n int, errno int) {
var _p0 *byte;
if len(p) > 0 { _p0 = &p[0]; }
if len(p) > 0 {
_p0 = &p[0];
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)));
n = int(r0);
errno = int(e1);
......@@ -221,6 +227,3 @@ func AudioStream(data *uint16, size *uintptr) (errno int) {
errno = int(e1);
return;
}
......@@ -3,7 +3,7 @@
package syscall
const(
const (
SYS_RESTART_SYSCALL = 0;
SYS_EXIT = 1;
SYS_FORK = 2;
......@@ -315,5 +315,4 @@ const(
SYS_FALLOCATE = 324;
)
func _darwin_system_call_conflict() {
}
func _darwin_system_call_conflict() {}
......@@ -3,7 +3,7 @@
package syscall
const(
const (
SYS_READ = 0;
SYS_WRITE = 1;
SYS_OPEN = 2;
......@@ -292,5 +292,4 @@ const(
SYS_FALLOCATE = 285;
)
func _darwin_system_call_conflict() {
}
func _darwin_system_call_conflict() {}
This diff is collapsed.
......@@ -3,7 +3,7 @@
package syscall
const(
const (
SYS_NULL = 1;
SYS_OPEN = 10;
SYS_CLOSE = 11;
......@@ -59,4 +59,3 @@ const(
SYS_SEM_POST = 102;
SYS_SEM_GET_VALUE = 103;
)
......@@ -179,7 +179,7 @@ type Statfs_t struct {
Bavail uint64;
Files uint64;
Ffree uint64;
Fsid [8]byte /* fsid */;
Fsid [8]byte; /* fsid */
Owner uint32;
Type uint32;
Flags uint32;
......@@ -204,7 +204,7 @@ type RawSockaddrInet4 struct {
Len uint8;
Family uint8;
Port uint16;
Addr [4]byte /* in_addr */;
Addr [4]byte; /* in_addr */
Zero [8]int8;
}
......@@ -213,7 +213,7 @@ type RawSockaddrInet6 struct {
Family uint8;
Port uint16;
Flowinfo uint32;
Addr [16]byte /* in6_addr */;
Addr [16]byte; /* in6_addr */
Scope_id uint32;
}
......
......@@ -181,7 +181,7 @@ type Statfs_t struct {
Bavail uint64;
Files uint64;
Ffree uint64;
Fsid [8]byte /* fsid */;
Fsid [8]byte; /* fsid */
Owner uint32;
Type uint32;
Flags uint32;
......@@ -206,7 +206,7 @@ type RawSockaddrInet4 struct {
Len uint8;
Family uint8;
Port uint16;
Addr [4]byte /* in_addr */;
Addr [4]byte; /* in_addr */
Zero [8]int8;
}
......@@ -215,7 +215,7 @@ type RawSockaddrInet6 struct {
Family uint8;
Port uint16;
Flowinfo uint32;
Addr [16]byte /* in6_addr */;
Addr [16]byte; /* in6_addr */
Scope_id uint32;
}
......
......@@ -246,7 +246,7 @@ type Statfs_t struct {
Bavail uint64;
Files uint64;
Ffree uint64;
Fsid [8]byte /* __fsid_t */;
Fsid [8]byte; /* __fsid_t */
Namelen int32;
Frsize int32;
Spare [5]int32;
......@@ -264,7 +264,7 @@ type Dirent struct {
type RawSockaddrInet4 struct {
Family uint16;
Port uint16;
Addr [4]byte /* in_addr */;
Addr [4]byte; /* in_addr */
Zero [8]uint8;
}
......@@ -272,7 +272,7 @@ type RawSockaddrInet6 struct {
Family uint16;
Port uint16;
Flowinfo uint32;
Addr [16]byte /* in6_addr */;
Addr [16]byte; /* in6_addr */
Scope_id uint32;
}
......
......@@ -246,7 +246,7 @@ type Statfs_t struct {
Bavail uint64;
Files uint64;
Ffree uint64;
Fsid [8]byte /* __fsid_t */;
Fsid [8]byte; /* __fsid_t */
Namelen int64;
Frsize int64;
Spare [5]int64;
......@@ -264,7 +264,7 @@ type Dirent struct {
type RawSockaddrInet4 struct {
Family uint16;
Port uint16;
Addr [4]byte /* in_addr */;
Addr [4]byte; /* in_addr */
Zero [8]uint8;
}
......@@ -272,7 +272,7 @@ type RawSockaddrInet6 struct {
Family uint16;
Port uint16;
Flowinfo uint32;
Addr [16]byte /* in6_addr */;
Addr [16]byte; /* in6_addr */
Scope_id uint32;
}
......
......@@ -246,7 +246,7 @@ type Statfs_t struct {
Bavail uint64;
Files uint64;
Ffree uint64;
Fsid [8]byte /* __fsid_t */;
Fsid [8]byte; /* __fsid_t */
Namelen int32;
Frsize int32;
Spare [5]int32;
......@@ -264,7 +264,7 @@ type Dirent struct {
type RawSockaddrInet4 struct {
Family uint16;
Port uint16;
Addr [4]byte /* in_addr */;
Addr [4]byte; /* in_addr */
Zero [8]uint8;
}
......@@ -272,7 +272,7 @@ type RawSockaddrInet6 struct {
Family uint16;
Port uint16;
Flowinfo uint32;
Addr [16]byte /* in6_addr */;
Addr [16]byte; /* in6_addr */
Scope_id uint32;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment