OLD | NEW |
1 #!/usr/bin/env perl | 1 #!/usr/bin/env perl |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file. | 4 # license that can be found in the LICENSE file. |
5 # | 5 # |
6 # Generate system call table for FreeBSD from master list | 6 # Generate system call table for FreeBSD from master list |
7 # (for example, /usr/src/sys/kern/syscalls.master). | 7 # (for example, /usr/src/sys/kern/syscalls.master). |
8 | 8 |
9 use strict; | 9 use strict; |
10 | 10 |
11 my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV); | 11 my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV); |
12 | 12 |
13 print <<EOF; | 13 print <<EOF; |
14 // $command | 14 // $command |
15 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT | 15 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT |
16 | 16 |
17 package syscall | 17 package unix |
18 | 18 |
19 const ( | 19 const ( |
20 EOF | 20 EOF |
21 | 21 |
22 while(<>){ | 22 while(<>){ |
23 if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ | 23 if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ |
24 my $num = $1; | 24 my $num = $1; |
25 my $proto = $2; | 25 my $proto = $2; |
26 my $name = "SYS_$3"; | 26 my $name = "SYS_$3"; |
27 $name =~ y/a-z/A-Z/; | 27 $name =~ y/a-z/A-Z/; |
(...skipping 19 matching lines...) Expand all Loading... |
47 print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(i
nt fd, \\\n"; | 47 print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(i
nt fd, \\\n"; |
48 print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\
n"; | 48 print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\
n"; |
49 print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int
*modep); }\n"; | 49 print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int
*modep); }\n"; |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 print <<EOF; | 54 print <<EOF; |
55 ) | 55 ) |
56 EOF | 56 EOF |
OLD | NEW |