Subject: Re: How do I create a include-file to match my new syscall?
To: Espen Jorde; IFI; H97 <espenjo@unik.no>
From: Eduardo E. Horvath <eeh@one-o.com>
List: tech-kern
Date: 03/07/2000 09:05:47
> Hi!
> 
> Part of the work for my master thesis involves adding some system
> calls to the kernel.
> 
> After some time I have figured out how to add my own system call. I
> have done this successfully with a 1.4.1 kernel.
> 
> Now my problem is how to access syscalls from user-space. I can call
> them by using "syscall(<syscallnumber>, arguments)". But i would love
> to be able to do something like this:
> 
> #include <foo.h>
> 
> foo(i, j, k);
> 
> Can anybody give me a hint on where I should look? Which directory
> should I put my .h file for it to compile correctly and end up in
> /usr/include. How should my .h file look. Any good examples?
> 
> Any help is appreciated!

Look in:

src/lib/libc/arch/${MACHINE_ARCH}/sys/syscall.S
src/lib/libc/arch/${MACHINE_ARCH}/SYS.h

and 

src/lib/libc/sys/Makefile.inc

Adding a syscall sould be as easy as adding an entry to
src/lib/libc/sys/Makefile.inc.  Of course, then it would be in libc.

=========================================================================
Eduardo Horvath				eeh@netbsd.org
	"I need to find a pithy new quote." -- me