Re: fork() source code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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().

Regards,
Shinpei Kato

On Thu, 11 Dec 2003 09:36:09 -0800 (PST)
Karthik M <k_mohanas@yahoo.com> wrote:

> > 
> Hi,
> 
> Yes, from our programs we call fork() which is a
> system call and all system call implementation will
> have the format of :
> 
> sys_<system_call_name>
> 
> So, do_fork() is the actual fork implementation
> whereas you can think of sys_fork() as a wrapper
> program. You can implement your own system call very
> easily. Just search for "adding a system call" in
> google and you will come across a lot of articles.
> 
> hope this helps
> 
> Karthik
> 
> --- shinny@j02.itscom.net wrote:
> > Hi, all
> > 
> > This question may be really basic though,
> > I'm studying how the linux creates a process and
> > schedules it on 2.6 at the moment.
> > The core function to create a process seems to be
> > do_fork() in kernel/fork.c.
> > And do_fork() is called from sys_fork() or
> > sys_clone().
> > But we usually use fork() not sys_fork(), don't we?
> > So I downloaded the latest libc(glibc-2.3.2) source
> > and looked for fork().
> > However there are several functions and files that
> > are likely to be fork().
> > Which fork() in which file is the real we call from
> > our program?
> > 
> > Regards,
> > Shinpei Kato
> > --
> > Kernelnewbies: Help each other learn about the Linux
> > kernel.
> > Archive:      
> > http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
> 



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux