Subject: COMPAT_SUNOS requires COMPAT_09, _10, and _43 ?
To: current users <current-users@NetBSD.ORG>
From: Paul Goyette <paul@pgoyette.bdt.com>
List: current-users
Date: 02/15/1997 16:05:27
Well, I accidentally built a kernel without COMPAT_09, and then tried to
build and load the compat_sunos.o LKM.  It complained about a couple of
undefined symbols, and failed to load.

Looking at the source of sys/compat/sunos/sunos_sysent.c one finds the
following defines:

	#ifdef COMPAT_43
	#define compat_43(func) __CONCAT(compat_43_,func)
	#else
	#define compat_43(func) sys_nosys
	#endif

	#ifdef COMPAT_09
	#define compat_09(func) __CONCAT(compat_09_,func)
	#else
	#define compat_09(func) sys_nosys
	#endif

	#ifdef COMPAT_10
	#define compat_10(func) __CONCAT(compat_10_,func)
	#else
	#define compat_10(func) sys_nosys
	#endif

Yet, nowhere in the rest of the file are these compat_xx(func) macros
invoked.  Instead, entries in the syscall table are made as follows:

        { 2, s(struct compat_09_sys_getdomainname_args),
            compat_09_sys_getdomainname },      /* 162 = getdomainname */
        { 2, s(struct compat_09_sys_setdomainname_args),
            compat_09_sys_setdomainname },      /* 163 = setdomainname */

(These are the ones that modload complained about when trying to load
the compat_sunos.o LKM.)

Normally, I'd just edit the offending source file (sunos_sysent.c), but in
this case I just happened to notice the warning at the top of the file:

/*
 * System call switch table.
 *
 * DO NOT EDIT-- this file is automatically generated.
 * created from NetBSD: syscalls.master,v 1.39 1997/01/31 02:18:56 thorpej
Exp 
 */

So, my question to all you kernel guru's:  should syscalls.master be
updated to use the macros?  Should the src/sys/kern/makesyscalls.sh
script be updated to generate the macros?  Or should the macros be removed
since they're not being used?