]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl
Merge pull request #27 from terraform-providers/go-modules-2019-02-22
[github/fretlink/terraform-provider-statuscake.git] / vendor / golang.org / x / sys / unix / mksysnum_freebsd.pl
CommitLineData
15c0b25d
AP
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 FreeBSD from master list
7# (for example, /usr/src/sys/kern/syscalls.master).
8
9use strict;
10
11if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
12 print STDERR "GOARCH or GOOS not defined in environment\n";
13 exit 1;
14}
15
16my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV);
17
18print <<EOF;
19// $command
20// Code generated by the command above; see README.md. DO NOT EDIT.
21
22// +build $ENV{'GOARCH'},$ENV{'GOOS'}
23
24package unix
25
26const (
27EOF
28
29while(<>){
30 if(/^([0-9]+)\s+\S+\s+(?:NO)?STD\s+({ \S+\s+(\w+).*)$/){
31 my $num = $1;
32 my $proto = $2;
33 my $name = "SYS_$3";
34 $name =~ y/a-z/A-Z/;
35
36 # There are multiple entries for enosys and nosys, so comment them out.
37 if($name =~ /^SYS_E?NOSYS$/){
38 $name = "// $name";
39 }
40 if($name eq 'SYS_SYS_EXIT'){
41 $name = 'SYS_EXIT';
42 }
43
44 print " $name = $num; // $proto\n";
45 }
46}
47
48print <<EOF;
49)
50EOF