Subject: kern/5886: makesyscalls.sh needs another syscall type.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <haszlaki@UAccess.NET>
List: netbsd-bugs
Date: 08/01/1998 01:45:13
>Number:         5886
>Category:       kern
>Synopsis:       makesyscalls.sh needs another syscall type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 31 23:50:02 1998
>Last-Modified:
>Originator:     Eric Haszlakiewicz
>Organization:
>Release:        current
>Environment:
System: NetBSD guinness 1.3F NetBSD 1.3F (GUINNESS) #0: Wed Jul 1 23:56:51 CDT 1998 nimenees@guinness:/tmp/GUINNESS i386


>Description:
	The currently present syscall types which makesyscalls.sh
accept always either define the args struct, the syscall declaration
or both.  This means that it is not possible to use the same function
in two different syscall numbers: it's not possible to have duplicate
syscalls within the same file (useful for Alpha linux compat).
>How-To-Repeat:
>Fix:
	Add a DUP type: does not define args or syscall number.


--- orig/makesyscalls.sh	Sat Aug  1 01:38:17 1998
+++ makesyscalls.sh	Sat Aug  1 01:24:31 1998
@@ -329,10 +329,13 @@
 		varargc = argc;
 }
 function putent(nodefs, compatwrap) {
+	# DUP functions only have an entry in the table but no other
+	# definitions since another line (the "real" one) does that.
+	#
 	# output syscall declaration for switch table.  INDIR functions
 	# get none, since they always have sys_nosys() for their table
 	# entries.
-	if (nodefs != "INDIR") {
+	if (nodefs != "INDIR" && nodefs != "DUP") {
 		prototype = "__P((struct proc *, void *, register_t *))"
 		if (compatwrap == "")
 			printf("int\t%s\t%s;\n", funcname,
@@ -399,12 +402,13 @@
 
 		printf("#define\t%s%s\t%d\n\n", constprefix, funcalias,
 		    syscall) > sysnumhdr
-	} else if (nodefs != "NODEF")
+	} else if (nodefs != "NODEF" && nodefs != "DUP")
 		printf("\t\t\t\t/* %d is %s %s */\n\n", syscall,
 		    compatwrap, funcalias) > sysnumhdr
 
 	# output syscall argument structure, if it has arguments
-	if (argc != 0 && nodefs != "NOARGS" && nodefs != "INDIR") {
+	if (argc != 0 && nodefs != "NOARGS" && \
+					nodefs != "INDIR" && nodefs != "DUP") {
 		if (compatwrap == "")
 			printf("\nstruct %s_args {\n", funcname) > sysarghdr
 		else
@@ -422,7 +426,7 @@
 	syscall++
 	next
 }
-$2 == "NODEF" || $2 == "NOARGS" || $2 == "INDIR" {
+$2 == "NODEF" || $2 == "NOARGS" || $2 == "INDIR" || $2 == "DUP" {
 	parseline()
 	putent($2, "")
 	syscall++
>Audit-Trail:
>Unformatted: