Re: fork() source code

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

 



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/


[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