summaryrefslogtreecommitdiff
path: root/src/syscall/mksyscall_solaris.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/syscall/mksyscall_solaris.pl')
-rwxr-xr-xsrc/syscall/mksyscall_solaris.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/syscall/mksyscall_solaris.pl b/src/syscall/mksyscall_solaris.pl
index 130d043d9..e72a4d11a 100755
--- a/src/syscall/mksyscall_solaris.pl
+++ b/src/syscall/mksyscall_solaris.pl
@@ -136,8 +136,8 @@ while(<>) {
# Prepare arguments to Syscall.
my @args = ();
+ my @uses = ();
my $n = 0;
- my @pin= ();
foreach my $p (@in) {
my ($name, $type) = parseparam($p);
if($type =~ /^\*/) {
@@ -147,12 +147,14 @@ while(<>) {
$text .= "\t_p$n, $errvar = $strconvfunc($name)\n";
$text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n";
push @args, "uintptr(unsafe.Pointer(_p$n))";
+ push @uses, "use(unsafe.Pointer(_p$n))";
$n++;
} elsif($type eq "string") {
print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n";
$text .= "\tvar _p$n $strconvtype\n";
$text .= "\t_p$n, _ = $strconvfunc($name)\n";
push @args, "uintptr(unsafe.Pointer(_p$n))";
+ push @uses, "use(unsafe.Pointer(_p$n))";
$n++;
} elsif($type =~ /^\[\](.*)/) {
# Convert slice into pointer, length.
@@ -176,7 +178,6 @@ while(<>) {
} else {
push @args, "uintptr($name)";
}
- push @pin, sprintf "\"%s=\", %s, ", $name, $name;
}
my $nargs = @args;
@@ -240,6 +241,9 @@ while(<>) {
} else {
$text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
}
+ foreach my $use (@uses) {
+ $text .= "\t$use\n";
+ }
$text .= $body;
if ($do_errno) {