Subject: Re: Multiple syscalls in an LKM
To: Pete Yandell <>
From: Bill Studenmund <>
List: tech-kern
Date: 07/02/2004 11:47:22
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 02, 2004 at 02:15:22PM +1000, Pete Yandell wrote:
> Is there an easy way to define multiple new syscalls in an LKM? Using
> the MOD_SYSCALL macro more than once results in errors (error:
> redefinition of `_module'), and pulling MOD_SYSCALL apart and trying
> to do the equivalent myself looks painful.

I think all you really need to do is make your lkm a MISC lkm, and have
your lkm loader do what lkmdispatch() and _lkm_syscall() do for LM_SYSCALL=

Another option is to have multiple syscall lkms. Have the first one=20
contain code it needs and code it shares with the second one. Load it=20
first. Save the output of the linking, then use that when loading the=20
second LKM. The second LKM can refer to routines in the first.

> Alternatively, am I better off just defining a single syscall and
> using a selector to choose the appropriate function, ioctl style?

That's up to you.

Take care,


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)