summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/mksysnum_darwin.pl
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
committerOndřej Surý <ondrej@sury.org>2011-08-03 16:54:30 +0200
commit28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch)
tree32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/pkg/syscall/mksysnum_darwin.pl
parente836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff)
downloadgolang-upstream/59.tar.gz
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/pkg/syscall/mksysnum_darwin.pl')
-rwxr-xr-xsrc/pkg/syscall/mksysnum_darwin.pl20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/pkg/syscall/mksysnum_darwin.pl b/src/pkg/syscall/mksysnum_darwin.pl
index d078a1836..fd4375b2f 100755
--- a/src/pkg/syscall/mksysnum_darwin.pl
+++ b/src/pkg/syscall/mksysnum_darwin.pl
@@ -3,8 +3,9 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
#
-# Generate system call table for Darwin from master list
-# (for example, xnu-1228/bsd/kern/syscalls.master).
+# Generate system call table for Darwin from sys/syscall.h
+
+use strict;
my $command = "mksysnum_darwin.pl " . join(' ', @ARGV);
@@ -18,18 +19,11 @@ const (
EOF
while(<>){
- if(/^([0-9]+)\s+ALL\s+({ \S+\s+(\w+).*})/){
- my $num = $1;
- my $proto = $2;
- my $name = "SYS_$3";
+ if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){
+ my $name = $1;
+ my $num = $2;
$name =~ y/a-z/A-Z/;
-
- # There are multiple entries for enosys and nosys, so comment them out.
- if($name =~ /^SYS_E?NOSYS$/){
- $name = "// $name";
- }
-
- print " $name = $num; // $proto\n";
+ print " SYS_$name = $num;"
}
}