...
Run Format

Text file src/syscall/mksysnum_darwin.pl

Documentation: syscall

     1#!/usr/bin/env perl
     2# Copyright 2009 The Go Authors. All rights reserved.
     3# Use of this source code is governed by a BSD-style
     4# license that can be found in the LICENSE file.
     5#
     6# Generate system call table for Darwin from sys/syscall.h
     7
     8use strict;
     9
    10my $command = "mksysnum_darwin.pl " . join(' ', @ARGV);
    11
    12print <<EOF;
    13// $command
    14// Code generated by the command above; DO NOT EDIT.
    15
    16package syscall
    17
    18const (
    19EOF
    20
    21while(<>){
    22	if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){
    23		my $name = $1;
    24		my $num = $2;
    25		$name =~ y/a-z/A-Z/;
    26		print "	SYS_$name = $num;"
    27	}
    28}
    29
    30print <<EOF;
    31)
    32EOF

View as plain text