diff --git a/sys/kern/makesyscalls.sh b/sys/kern/makesyscalls.sh index bc02bc7a2584..545a169dd6d4 100644 --- a/sys/kern/makesyscalls.sh +++ b/sys/kern/makesyscalls.sh @@ -1,4 +1,4 @@ -# $NetBSD: makesyscalls.sh,v 1.170 2018/08/10 21:44:59 pgoyette Exp $ +# $NetBSD: makesyscalls.sh,v 1.171 2018/08/26 11:48:00 kre Exp $ # # Copyright (c) 1994, 1996, 2000 Christopher G. Demetriou # All rights reserved. @@ -78,6 +78,15 @@ case $1 in *) . ./$1;; esac +fail=false +case "${nsysent:-0}" in +*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for nsysent";; +esac +case "${maxsysargs:-0}" in +*[!0-9]*) fail=true; printf >&2 '%s\n' "Non numeric value for maxsysargs";; +esac +$fail && exit 1 + # tmp files: sysdcl="sysent.dcl" sysprotos="sys.protos" @@ -172,7 +181,7 @@ BEGIN { if (!registertype) { registertype = \"register_t\" } - nsysent = \"$nsysent\" + nsysent = ${nsysent:-0} sysdcl = \"$sysdcl\" syscompat_pref = \"$syscompat_pref\" @@ -182,7 +191,7 @@ BEGIN { rumpprotos = \"$rumpprotos\" rumptypes = \"$rumptypes\" sys_nosys = \"$sys_nosys\" - maxsysargs = \"$maxsysargs\" + maxsysargs = ${maxsysargs:-8} rumpnoflags=\"$rumpnoflags\" rumpnosys=\"$rumpnosys\" rumpnomodule=\"$rumpnomodule\" @@ -1130,12 +1139,6 @@ END { maxsyscall = syscall - # XXX - # XXX The following comparisons with nsysent will produce - # XXX unexpected results if (for example) syscall has a - # XXX value of 900 and nsysent has a value of "1024". We - # XXX probably ought to make nsysent a numeric variable. - # XXX if (nsysent) { if (syscall > nsysent) { printf("%s: line %d: too many syscalls [%d > %d]\n", infile, NR, syscall, nsysent)