diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-08-03 16:54:30 +0200 |
commit | 28592ee1ea1f5cdffcf85472f9de0285d928cf12 (patch) | |
tree | 32944e18b23f7fe4a0818a694aa2a6dfb1835463 /src/pkg/syscall/mksysnum_darwin.pl | |
parent | e836bee4716dc0d4d913537ad3ad1925a7ac32d0 (diff) | |
download | golang-upstream/59.tar.gz |
Imported Upstream version 59upstream/59
Diffstat (limited to 'src/pkg/syscall/mksysnum_darwin.pl')
-rwxr-xr-x | src/pkg/syscall/mksysnum_darwin.pl | 20 |
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;" } } |