aboutsummaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/unix/mksyscall.pl
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/unix/mksyscall.pl')
-rwxr-xr-xvendor/golang.org/x/sys/unix/mksyscall.pl17
1 files changed, 15 insertions, 2 deletions
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.pl b/vendor/golang.org/x/sys/unix/mksyscall.pl
index fb929b4..1f6b926 100755
--- a/vendor/golang.org/x/sys/unix/mksyscall.pl
+++ b/vendor/golang.org/x/sys/unix/mksyscall.pl
@@ -210,7 +210,15 @@ while(<>) {
# Determine which form to use; pad args with zeros.
my $asm = "Syscall";
if ($nonblock) {
- $asm = "RawSyscall";
+ if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
+ $asm = "RawSyscallNoError";
+ } else {
+ $asm = "RawSyscall";
+ }
+ } else {
+ if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
+ $asm = "SyscallNoError";
+ }
}
if(@args <= 3) {
while(@args < 3) {
@@ -284,7 +292,12 @@ while(<>) {
if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
$text .= "\t$call\n";
} else {
- $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
+ if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
+ # raw syscall without error on Linux, see golang.org/issue/22924
+ $text .= "\t$ret[0], $ret[1] := $call\n";
+ } else {
+ $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
+ }
}
$text .= $body;