Subject: Re: how to use syscalls
To: Robin Kumar <c_k_a_p@yahoo.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 06/25/2000 21:36:17
On Sun, Jun 25, 2000 at 11:48:29AM -0700, Robin Kumar wrote:
> 
> I was trying to add a system call to NetBSD 1.4.1.
> What i have done is added the entries in
> syscalls.master and some other syscall files. I have
> added code for syscall in xyz.c.It is has been
> compiled 
> also, but the problem is i do not know how can i
> use it from a user process.	
> 	What has to be done to call it from a C
> programme.Please answer in detail as i donot know
> anything about it.I want to mention one more thing
> that
> i do not have /usr/src/lib rather i have
> /usr/src/sys/lib.

Ok, you've done the kernel part now you need to add your syscall to libc.
Grab from ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-1.4.1/source/sets/src.tgz
and untar it (I suspect you've only the kernel sources installed).
Then you'll have the libc sources in /usr/src/lib/libc. Add you syscall here,
and recompile/reinstall libc.

>    Is ther any other way like in Linux,one can use
> standard macros in C programme to call a system call.

I don't know much about linux, but I suspect in NetBSD this is all
hidden in libc.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--