2009-06-01 23:14:57 -06:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
#
|
2011-06-14 10:56:46 -06:00
|
|
|
# Generate system call table for Darwin from sys/syscall.h
|
2009-06-01 23:14:57 -06:00
|
|
|
|
2011-06-15 18:41:07 -06:00
|
|
|
use strict;
|
|
|
|
|
2011-03-21 14:02:10 -06:00
|
|
|
my $command = "mksysnum_darwin.pl " . join(' ', @ARGV);
|
2009-06-01 23:14:57 -06:00
|
|
|
|
|
|
|
print <<EOF;
|
|
|
|
// $command
|
|
|
|
// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
|
|
|
|
|
|
|
|
package syscall
|
|
|
|
|
|
|
|
const (
|
|
|
|
EOF
|
|
|
|
|
|
|
|
while(<>){
|
2011-06-14 10:56:46 -06:00
|
|
|
if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){
|
|
|
|
my $name = $1;
|
|
|
|
my $num = $2;
|
2009-06-01 23:14:57 -06:00
|
|
|
$name =~ y/a-z/A-Z/;
|
2011-06-14 10:56:46 -06:00
|
|
|
print " SYS_$name = $num;"
|
2009-06-01 23:14:57 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
print <<EOF;
|
|
|
|
)
|
|
|
|
EOF
|