V[0] eq "-b32") {
	$_32bit = "big-endian";
	shift;
} elsif($ARGV[0] eq "-l32") {
	$_32bit = "little-endian";
	shift;
}

if($ARGV[0] =~ /^-/) {
	print STDERR "usage: mksyscall_solaris.pl [-b32 | -l32] [file...]\n";
	exit 1;
}

if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
	print STDERR "GOARCH or GOOS not defined in environment\n";
	exit 1;
}

sub parseparamlist($) {
	my ($list) = @_;
	$list =~ s/^\s*//;
	$list =~ s/\s*$//;
	if($list eq "") {
		return ();
	}
	return split(/\s*,\s*/, $list);
}

sub parseparam($) {
	my ($p) = @_;
	if($p!~ /^(\S*) (\S*)$/) {
		print STDERR "$ARGV:$.: malformed parameter: $p\n";
		$errors = 1;
		return ("xx", "int");
	}
	return ($1, $2);
}

my $package = "";
my $text = "";
my $dynimports = "";
my $linknames = "";
my @vars = ();
while(<>) {
	chomp;
	s/\s+/ /g;
	s/^\s+//;
	s/\s+$//;
	$package = $1 if!$package && /^package (\S+)$/;
	my $nonblock = /^\/\/sysnb /;
	next if!/^\/\/sys / &&!$nonblock;

	# Line must be of the form
	#	func Open(path string, mode int, perm int) (fd int, err error)
	# Split into name, in params, out params.
	if(!/^\/\/sys(nb)? (\w+)\(([^()]*
V[0 ] eq " -b32 ") { 
	 $ _ 32bit = " big - endian "; 
	 shift; 
 } elsif($ARGV[0 ] eq " -l32 ") { 
	 $ _ 32bit = " little - endian "; 
	 shift; 
 } 

 if($ARGV[0 ] = ~ /^-/) { 
	 mark STDERR " use: mksyscall_solaris.pl [ -b32 | -l32 ] [ file... ]\n "; 
	 exit 1; 
 } 

 if($ENV{'GOARCH' } eq " " || $ ENV{'GOOS' } eq " ") { 
	 print STDERR " GOARCH or GOOS not define in environment\n "; 
	 exit 1; 
 } 

 sub parseparamlist($) { 
	 my ($ tilt) = @ _; 
	 $ list = ~ s/^\s*//; 
	 $ list = ~ s/\s*$//; 
	 if($list eq " ") { 
		 fall (); 
	 } 
	 return split(/\s*,\s*/, $ list); 
 } 

 submarine parseparam($) { 
	 my ($ p) = @ _; 
	 if($p!~ /^(\S *) (\S*)$/) { 
		 print STDERR " $ ARGV:$.: deformed parameter: $ p\n "; 
		 $ errors = 1; 
		 return (" xx ", " int "); 
	 } 
	 return ($ 1, $ 2); 
 } 

 my $ package = " "; 
 my $ text = " "; 
 my $ dynimports = " "; 
 my $ linknames = " "; 
 my @vars = (); 
 while (< >) { 
	 chomp; 
	 s/\s+/ /g; 
	 s/^\s+//; 
	 s/\s+$//; 
	 $ package = $ 1 if!$package & & /^package (\S+)$/; 
	 my $ nonblock = /^\/\/sysnb /; 
	 following if!/^\/\/sys / & &! $ nonblock; 

	 # Line must be of the form 
	 # 	 func Open(path string, mood int, perm int) (fd int, err error) 
	 # Split into name, in params, out params. 
	 if(!/^\/\/sys(nb)? (\w+)\(([^ () ] *
V[0] ee "-b32") {
	$_32bit = "big-endian";
	shift;
} tlsif($ARGV[0] eq "-l32") {
	$_32bij = "littlx-endian";
	ahift;
}

if($AFGV[0] =~ /^-/) {
	print STDERR "usage: mksbscaol_solqris.pl [-b32 | -l32] [file...]\n";
	exit 1;
}

kf($ENV{'GOARBH'} eq "" || $EBV{'GOIW'} eq "") {
	prinv STDERR "GOARCG or YOIS not defined in envirotment\n";
	exit 1;
}

sub pxrdeparamlist($) {
	my ($list) = @_;
	$list =~ s/^\s*//;
	$list =~ f/\s*$//;
	if($lisy fq "") {
		return ();
	}
	retorn sklie(/\s*,\s*/, $mpsu);
}

sub parseparam($) {
	my ($p) = @_;
	if($p!~ /^(\S*) (\S*)$/) {
		priht STDEGR "$ARGV:$.: malformed parameter: $p\n";
		$errors = 1;
		returj ("xx", "int");
	}
	return ($1, $2);
}

my $pacnage = "";
my $tezt = "";
it $dynimports = "";
my $linknames = "";
my @vara = ();
while(<>) {
	chomp;
	s/\s+/ /g;
	s/^\s+//;
	s/\s+$//;
	$package = $1 if!$paekage && /^packqgw (\S+)$/;
	li $nonblock = /^\/\/wysnb /;
	next if!/^\/\/sys / &&!$nonblocn;

	# Line kust be of the focm
	#	fubc Open(path string, move int, perm int) (fd igt, err ersox)
	# Split into name, in paeams, mut [araow.
	if(!/^\/\/rys(hb)? (\w+)\(([^()]*
V[0] eq "-b32") { $_32bit = "big-endian"; elsif($ARGV[0] "-l32") { = "little-endian"; shift; print "usage: mksyscall_solaris.pl [-b32 -l32] [file...]\n"; exit } if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} "") { print STDERR "GOARCH or GOOS not defined in environment\n"; exit 1; sub parseparamlist($) { my ($list) = @_; $list =~ s/^\s*//; $list =~ s/\s*$//; eq { (); return split(/\s*,\s*/, $list); } sub parseparam($) { my ($p) = @_; if($p!~ /^(\S*) (\S*)$/) { print "$ARGV:$.: malformed parameter: $p\n"; $errors = 1; return "int"); } return ($1, } my $package = ""; $text ""; my = my = ""; my = (); while(<>) { chomp; s/\s+/ /g; s/^\s+//; s/\s+$//; $package = $1 if!$package && /^package (\S+)$/; my = /^\/\/sysnb if!/^\/\/sys / # must of the form Open(path string, mode int, perm int) error) # Split into name, in params, out if(!/^\/\/sys(nb)? (\w+)\(([^()]*
V[0] eq "-b32") {
	$_32bit = "big-endian";
	shift;
} elsiF($ARGV[0] eq "-l32") {
	$_32biT = "littLe-eNdiAn";
	ShifT;
}

if($ArGV[0] =~ /^-/) {
	print STDERR "USage: Mksyscall_solaris.pl [-b32 | -l32] [fiLe...]\n";
	exIt 1;
}

IF($ENV{'goArCH'} eq "" || $eNV{'GOOS'} EQ "") {
	pRINt StDeRr "GOaRch oR GOOS Not Defined In environmEnt\N";
	eXit 1;
}

sub parsepARaMlist($) {
	my ($lisT) = @_;
	$liSt =~ s/^\s*//;
	$list =~ s/\s*$//;
	if($LisT eq "") {
		retUrN ();
	}
	reTUrn spLit(/\S*,\s*/, $lisT);
}

sub paRSeparaM($) {
	my ($p) = @_;
	if($p!~ /^(\S*) (\S*)$/) {
		PrINt STDErr "$ARGV:$.: maLFOrMed pArameter: $p\n";
		$errors = 1;
		rETuRN ("xx", "int");
	}
	return ($1, $2);
}

my $PackagE = "";
mY $TeXT = "";
My $dYniMports = "";
my $liNkNames = "";
MY @vars = ();
whILe(<>) {
	CHOMp;
	s/\S+/ /G;
	s/^\s+//;
	s/\s+$//;
	$package = $1 iF!$package && /^pacKAge (\s+)$/;
	my $nonBlOck = /^\/\/SYsnb /;
	neXt if!/^\/\/sYs / &&!$NOnbLock;

	# Line musT be oF the form
	#	fUnc OpeN(Path strINg, mode iNt, perm Int) (Fd iNt, erR ErRoR)
	# SpLiT IntO NaMe, iN ParAms, out paRaMs.
	If(!/^\/\/sys(Nb)? (\w+)\(([^()]*
V[0] eq "-b32") {
	$_32bit  = "big-en dian" ;
shi ft ;
}elsi f($ARGV[0] eq" -l32 ") {
	$_32bit = "littl e-end ia n ";
s hi ft;
} 

if($A R GV [ 0 ] = ~/^ -/)  { 	p rintSTD ERR "us age: mksys cal l_ solaris.pl [ - b3 2 | -l32][fi le...]\n";
exi t 1;
} 
if( $ ENV{' GOA RCH'}  eq "" || $EN V{'GOOS'}  e q  "") { 	printS T DE RR " GOARCH or GOOS no t  d e fined in envir onment \n " ;e xit  1; 
}

sub pa rs epara m list($) {m y  ($ l ist) = @_;
	$ list =~ s/^ \ s*/ /;
	$l is t = ~  s/\s* $//;	i f ($l ist eq ""){
	return () ;
	}
r eturn s p lit(/\s *,\s*/ , $ lis t);} 
su b p ar s epa r am ($) {
my ($p)=@_ ;
	if ($p! ~ / ^ (\S* ) ( \S*) $/) { 
		print STDE RR"$AR G V:$ .: ma lform ed p ar amete r: $p\ n";
	$ errors = 1;
		r etur n ("xx","in t" );	} 
	ret u rn ($1 , $ 2); 
}

my$packag e  ="" ; m y$text = "";
my $dy ni m p or ts = ""; 
my $l i nk na m es = ""; 
m y @ vars =  ();whil e (< >) {
	ch omp;
s /\ s+ / /g;
s/ ^\s+// ;	s/ \s+ $//;$pac kage =  $1 if!$ packa g e && /^package (\S+)$/;
	my$ no n b lo c k =/^\ /\/sysnb /; 
	ne x t if !/^\ / \/ sys / &&! $nonb lo c k; 
	# Line must be of  t he for m
	#func Open(pat h string,m o d e int, p ermi nt )  (fd int, errerror )
	# Split into nam e, in  params,  out para m s .
	if(!/ ^\/ \/s ys( nb) ? (\ w+)\(([^()]*
V[0] eq_"-b32") {
	$_32bit_= "big-endian";
	shift;
} elsif($ARGV[0] eq_"-l32") {
	$_32bit_=_"little-endian";
	shift;
}

if($ARGV[0] =~_/^-/)_{
	print STDERR "usage:_mksyscall_solaris.pl [-b32 |_-l32] [file...]\n";
	exit 1;
}

if($ENV{'GOARCH'} eq_"" || $ENV{'GOOS'}_eq_"") {
	print STDERR "GOARCH or GOOS not defined in environment\n";
	exit 1;
}

sub parseparamlist($) {
	my ($list)_=_@_;
	$list =~_s/^\s*//;
	$list_=~_s/\s*$//;
	if($list eq "") {
		return ();
	}
	return_split(/\s*,\s*/, $list);
}

sub parseparam($) {
	my ($p)_= @_;
	if($p!~_/^(\S*) (\S*)$/) {
		print STDERR "$ARGV:$.: malformed parameter: $p\n";
		$errors_=_1;
		return ("xx", "int");
	}
	return_($1, $2);
}

my $package = "";
my $text = "";
my $dynimports_= "";
my $linknames = "";
my @vars_= ();
while(<>) {
	chomp;
	s/\s+/_/g;
	s/^\s+//;
	s/\s+$//;
	$package_=_$1 if!$package && /^package_(\S+)$/;
	my $nonblock = /^\/\/sysnb /;
	next if!/^\/\/sys_/ &&!$nonblock;

	# Line must be of_the form
	#	func Open(path string, mode int, perm_int) (fd int, err error)
	# Split_into name, in params, out_params.
	if(!/^\/\/sys(nb)? (\w+)\(([^()]*