Plan 9 from Bell Labs’s /usr/web/sources/contrib/cinap_lenrek/linuxemu3/linuxcalltab.awk

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/awk -f
BEGIN {
	nsys = 0
}

/^#/ {
	next
}

{
	i=$1
	if(nsys > i){
		print "BROKEN TABLE: "nsys" > "i
		exit
	}
	while(nsys < i){
		sysarg[nsys] = 0
		sysnam[nsys] = "nosys"nsys
		sysfun[nsys] = "sys_nosys"
		nsys++;
	}
	sysarg[nsys] = $2
	sysnam[nsys] = $3
	sysfun[nsys] = $4
	nsys++
}

END {
	print "static Linuxcall linuxcalltab[] = {"
	for(i=0; i<nsys; i++){
		print "	{	/* "i" */"
		print "		.name = \""sysnam[i]"\","
		print "		.func = "sysfun[i]","
		print "		.stub = fcall"sysarg[i]","
		print "	},"
	}
	print "};"
	print ""
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.