Commit a2f72cc8 authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

syscall: support Linux syscalls without error return on mipsx/mips64x

Like on other architectures, use rawSyscallNoError for Linux syscalls
that don't return an error and convert all applicable occurences of
RawSyscall to use it instead.

This was missed in CL 84485 because mkall.sh doesn't support
mipsx/mips64x, so add the corresponding entries as well.

Updates #22924

Change-Id: I762cbee0827140b9890c4a10830e0b4cd33de92f
Reviewed-on: https://go-review.googlesource.com/118655
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 72ce047a
...@@ -189,6 +189,36 @@ linux_arm64) ...@@ -189,6 +189,36 @@ linux_arm64)
# API consistent between platforms. # API consistent between platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;; ;;
linux_mips)
GOOSARCH_in=syscall_linux_mipsx.go
unistd_h=/usr/include/asm/unistd.h
mksyscall="./mksyscall.pl -b32 -arm"
mkerrors="$mkerrors"
mksysnum="./mksysnum_linux.pl $unistd_h"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
linux_mipsle)
GOOSARCH_in=syscall_linux_mipsx.go
unistd_h=/usr/include/asm/unistd.h
mksyscall="./mksyscall.pl -l32 -arm"
mkerrors="$mkerrors"
mksysnum="./mksysnum_linux.pl $unistd_h"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
linux_mips64)
GOOSARCH_in=syscall_linux_mips64x.go
unistd_h=/usr/include/asm/unistd.h
mkerrors="$mkerrors -m64"
mksysnum="./mksysnum_linux.pl $unistd_h"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
linux_mips64le)
GOOSARCH_in=syscall_linux_mips64x.go
unistd_h=/usr/include/asm/unistd.h
mkerrors="$mkerrors -m64"
mksysnum="./mksysnum_linux.pl $unistd_h"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
linux_ppc64) linux_ppc64)
GOOSARCH_in=syscall_linux_ppc64x.go GOOSARCH_in=syscall_linux_ppc64x.go
unistd_h=/usr/include/asm/unistd.h unistd_h=/usr/include/asm/unistd.h
......
...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) { func Getpid() (pid int) {
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0) pid = int(r0)
return return
} }
...@@ -492,7 +492,7 @@ func Getpid() (pid int) { ...@@ -492,7 +492,7 @@ func Getpid() (pid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) { func Getppid() (ppid int) {
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0) ppid = int(r0)
return return
} }
...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) { ...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) { func Gettid() (tid int) {
r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0) tid = int(r0)
return return
} }
...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) { func Umask(mask int) (oldmask int) {
r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) r0, _ := rawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0) oldmask = int(r0)
return return
} }
...@@ -1169,7 +1169,7 @@ func Ftruncate(fd int, length int64) (err error) { ...@@ -1169,7 +1169,7 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) { func Getegid() (egid int) {
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0) egid = int(r0)
return return
} }
...@@ -1177,7 +1177,7 @@ func Getegid() (egid int) { ...@@ -1177,7 +1177,7 @@ func Getegid() (egid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) { func Geteuid() (euid int) {
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0) euid = int(r0)
return return
} }
...@@ -1185,7 +1185,7 @@ func Geteuid() (euid int) { ...@@ -1185,7 +1185,7 @@ func Geteuid() (euid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) { func Getgid() (gid int) {
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0) gid = int(r0)
return return
} }
...@@ -1193,7 +1193,7 @@ func Getgid() (gid int) { ...@@ -1193,7 +1193,7 @@ func Getgid() (gid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) { func Getuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0) uid = int(r0)
return return
} }
......
...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) { func Getpid() (pid int) {
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0) pid = int(r0)
return return
} }
...@@ -492,7 +492,7 @@ func Getpid() (pid int) { ...@@ -492,7 +492,7 @@ func Getpid() (pid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) { func Getppid() (ppid int) {
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0) ppid = int(r0)
return return
} }
...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) { ...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) { func Gettid() (tid int) {
r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0) tid = int(r0)
return return
} }
...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) { func Umask(mask int) (oldmask int) {
r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) r0, _ := rawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0) oldmask = int(r0)
return return
} }
...@@ -1179,7 +1179,7 @@ func Ftruncate(fd int, length int64) (err error) { ...@@ -1179,7 +1179,7 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) { func Getegid() (egid int) {
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0) egid = int(r0)
return return
} }
...@@ -1187,7 +1187,7 @@ func Getegid() (egid int) { ...@@ -1187,7 +1187,7 @@ func Getegid() (egid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) { func Geteuid() (euid int) {
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0) euid = int(r0)
return return
} }
...@@ -1195,7 +1195,7 @@ func Geteuid() (euid int) { ...@@ -1195,7 +1195,7 @@ func Geteuid() (euid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) { func Getgid() (gid int) {
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0) gid = int(r0)
return return
} }
...@@ -1213,7 +1213,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { ...@@ -1213,7 +1213,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) { func Getuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0) uid = int(r0)
return return
} }
......
...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) { func Getpid() (pid int) {
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0) pid = int(r0)
return return
} }
...@@ -492,7 +492,7 @@ func Getpid() (pid int) { ...@@ -492,7 +492,7 @@ func Getpid() (pid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) { func Getppid() (ppid int) {
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0) ppid = int(r0)
return return
} }
...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) { ...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) { func Gettid() (tid int) {
r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0) tid = int(r0)
return return
} }
...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) { func Umask(mask int) (oldmask int) {
r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) r0, _ := rawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0) oldmask = int(r0)
return return
} }
...@@ -1179,7 +1179,7 @@ func Ftruncate(fd int, length int64) (err error) { ...@@ -1179,7 +1179,7 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) { func Getegid() (egid int) {
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0) egid = int(r0)
return return
} }
...@@ -1187,7 +1187,7 @@ func Getegid() (egid int) { ...@@ -1187,7 +1187,7 @@ func Getegid() (egid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) { func Geteuid() (euid int) {
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0) euid = int(r0)
return return
} }
...@@ -1195,7 +1195,7 @@ func Geteuid() (euid int) { ...@@ -1195,7 +1195,7 @@ func Geteuid() (euid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) { func Getgid() (gid int) {
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0) gid = int(r0)
return return
} }
...@@ -1213,7 +1213,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) { ...@@ -1213,7 +1213,7 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) { func Getuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0) uid = int(r0)
return return
} }
......
...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) { ...@@ -484,7 +484,7 @@ func Getpgid(pid int) (pgid int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) { func Getpid() (pid int) {
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0) pid = int(r0)
return return
} }
...@@ -492,7 +492,7 @@ func Getpid() (pid int) { ...@@ -492,7 +492,7 @@ func Getpid() (pid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) { func Getppid() (ppid int) {
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0) ppid = int(r0)
return return
} }
...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) { ...@@ -521,7 +521,7 @@ func Getrusage(who int, rusage *Rusage) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) { func Gettid() (tid int) {
r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0) tid = int(r0)
return return
} }
...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) { ...@@ -928,7 +928,7 @@ func Times(tms *Tms) (ticks uintptr, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) { func Umask(mask int) (oldmask int) {
r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) r0, _ := rawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0) oldmask = int(r0)
return return
} }
...@@ -1169,7 +1169,7 @@ func Ftruncate(fd int, length int64) (err error) { ...@@ -1169,7 +1169,7 @@ func Ftruncate(fd int, length int64) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) { func Getegid() (egid int) {
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0) egid = int(r0)
return return
} }
...@@ -1177,7 +1177,7 @@ func Getegid() (egid int) { ...@@ -1177,7 +1177,7 @@ func Getegid() (egid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) { func Geteuid() (euid int) {
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0) euid = int(r0)
return return
} }
...@@ -1185,7 +1185,7 @@ func Geteuid() (euid int) { ...@@ -1185,7 +1185,7 @@ func Geteuid() (euid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) { func Getgid() (gid int) {
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0) gid = int(r0)
return return
} }
...@@ -1193,7 +1193,7 @@ func Getgid() (gid int) { ...@@ -1193,7 +1193,7 @@ func Getgid() (gid int) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) { func Getuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) r0, _ := rawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0) uid = int(r0)
return return
} }
......
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