diff options
| -rwxr-xr-x | src/pkg/syscall/mksyscall.sh | 1 | ||||
| -rw-r--r-- | src/pkg/syscall/zsyscall_darwin_386.go | 3 | ||||
| -rw-r--r-- | src/pkg/syscall/zsyscall_freebsd_386.go | 3 | ||||
| -rw-r--r-- | src/pkg/syscall/zsyscall_linux_386.go | 6 | ||||
| -rw-r--r-- | src/pkg/syscall/zsyscall_linux_arm.go | 51 | 
5 files changed, 35 insertions, 29 deletions
| diff --git a/src/pkg/syscall/mksyscall.sh b/src/pkg/syscall/mksyscall.sh index 07a8783ff..215882552 100755 --- a/src/pkg/syscall/mksyscall.sh +++ b/src/pkg/syscall/mksyscall.sh @@ -158,7 +158,6 @@ while(<>) {  			}  			$ret[$i] = sprintf("r%d", $i);  			$ret[$i+1] = sprintf("r%d", $i+1); -			$i++;		# loop will do another $i++  		}  		$body .= "\t$name = $type($reg);\n";  	} diff --git a/src/pkg/syscall/zsyscall_darwin_386.go b/src/pkg/syscall/zsyscall_darwin_386.go index 21322f62b..f4c33edc9 100644 --- a/src/pkg/syscall/zsyscall_darwin_386.go +++ b/src/pkg/syscall/zsyscall_darwin_386.go @@ -502,8 +502,9 @@ 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, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0);  	newoffset = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } diff --git a/src/pkg/syscall/zsyscall_freebsd_386.go b/src/pkg/syscall/zsyscall_freebsd_386.go index 5ce8c8130..055d12775 100644 --- a/src/pkg/syscall/zsyscall_freebsd_386.go +++ b/src/pkg/syscall/zsyscall_freebsd_386.go @@ -502,8 +502,9 @@ 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, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0);  	newoffset = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } diff --git a/src/pkg/syscall/zsyscall_linux_386.go b/src/pkg/syscall/zsyscall_linux_386.go index 26b07618b..e7019b63e 100644 --- a/src/pkg/syscall/zsyscall_linux_386.go +++ b/src/pkg/syscall/zsyscall_linux_386.go @@ -453,8 +453,9 @@ func Setuid(uid int) (errno int) {  }  func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { -	r0, r1, _ := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)); +	r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags));  	n = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } @@ -476,8 +477,9 @@ func Sysinfo(info *Sysinfo_t) (errno int) {  }  func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { -	r0, r1, _ := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0); +	r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0);  	n = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } diff --git a/src/pkg/syscall/zsyscall_linux_arm.go b/src/pkg/syscall/zsyscall_linux_arm.go index f8cd8a70a..c221d3c48 100644 --- a/src/pkg/syscall/zsyscall_linux_arm.go +++ b/src/pkg/syscall/zsyscall_linux_arm.go @@ -453,8 +453,9 @@ func Setuid(uid int) (errno int) {  }  func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, errno int) { -	r0, r1, _ := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)); +	r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags));  	n = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } @@ -476,8 +477,9 @@ func Sysinfo(info *Sysinfo_t) (errno int) {  }  func Tee(rfd int, wfd int, len int, flags int) (n int64, errno int) { -	r0, r1, _ := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0); +	r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0);  	n = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } @@ -637,6 +639,27 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (errno int) {  	return;  } +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { +	var _p0 *byte; +	if len(p) > 0 { +		_p0 = &p[0] +	} +	r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))); +	n = int(r0); +	errno = int(e1); +	return; +} + +func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) { +	var _p0 *byte; +	if len(buf) > 0 { +		_p0 = &buf[0] +	} +	_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)); +	errno = int(e1); +	return; +} +  func Chown(path string, uid int, gid int) (errno int) {  	_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(uid), uintptr(gid));  	errno = int(e1); @@ -704,8 +727,9 @@ 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, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0);  	off = int64(int64(r1)<<32 | int64(r0)); +	errno = int(e1);  	return;  } @@ -775,24 +799,3 @@ func Statfs(path string, buf *Statfs_t) (errno int) {  	errno = int(e1);  	return;  } - -func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, errno int) { -	var _p0 *byte; -	if len(p) > 0 { -		_p0 = &p[0] -	} -	r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))); -	n = int(r0); -	errno = int(e1); -	return; -} - -func sendto(s int, buf []byte, flags int, to uintptr, addrlen _Socklen) (errno int) { -	var _p0 *byte; -	if len(buf) > 0 { -		_p0 = &buf[0] -	} -	_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)); -	errno = int(e1); -	return; -} | 
