Shinpei Kato <shinny@j02.itscom.net> writes: > Thank you for your help. > > Maybe my expression was not enough. > I can understand how to add the system call into the kernel. > All I have to do is to add proper descriptions into unistd.h, entry.S > and use _syscallX() macros. > The thing I want to know is how the libc calls do_fork(). do_fork() has > one parameter related to registers but fork() doesn't have any parameter. > So I want to know how the fork() set the parameter. > And to confirm it, I want the source code of fork(). In glibc, see ./sysdeps/unix/sysv/linux/i386/clone.S, where the registers are set up and the "int 0x80" instruction is used to trap into the O.S. system call handler. The clone system call is how forking is done nowadays. -- --Ed L Cashin | PGP public key: ecashin@uga.edu | http://noserose.net/e/pgp/ -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/