LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   need fork() source code (http://www.linuxquestions.org/questions/linux-software-2/need-fork-source-code-4175437412/)

sachinchhatna 11-16-2012 05:13 AM

need fork() source code
 
Dear Sir/Madam,
I am mtech student of IITkgp, roll no - 11CS60R23. I want fork() source code.If possible please help me.
thanking you,
regards,
Sachin Agarwalla

druuna 11-16-2012 05:23 AM

Quote:

Originally Posted by sachinchhatna (Post 4830683)
I want fork() source code.If possible please help me.

Download a linux kernel (www.kernel.org), unpack it. fork.c resides in the /path/to/linux-x.y.z/kernel/ directory.

resetreset 11-19-2012 08:01 AM

WHY do you want the fork source code?

fakie_flip 11-19-2012 01:11 PM

From man man:

Quote:

1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]
So either 2 or 3,

man 2 fork
man 3 fork

Both show:
Quote:

#include <unistd.h>
Code:

[bull:~]$ locate unistd.h
/usr/include/unistd.h
/usr/include/asm/unistd.h
/usr/include/asm-generic/unistd.h
/usr/include/bits/unistd.h
/usr/include/linux/unistd.h
/usr/include/sys/unistd.h
/usr/share/man/man0p/unistd.h.0p.gz
/usr/src/kernels/3.4.11-1.fc16.x86_64/arch/x86/include/asm/ia32_unistd.h
/usr/src/kernels/3.4.11-1.fc16.x86_64/arch/x86/include/asm/unistd.h
/usr/src/kernels/3.4.11-1.fc16.x86_64/include/asm-generic/unistd.h
/usr/src/kernels/3.4.11-1.fc16.x86_64/include/linux/unistd.h
/usr/src/kernels/3.6.2-1.fc16.x86_64/arch/x86/include/asm/ia32_unistd.h
/usr/src/kernels/3.6.2-1.fc16.x86_64/arch/x86/include/asm/unistd.h
/usr/src/kernels/3.6.2-1.fc16.x86_64/include/asm-generic/unistd.h
/usr/src/kernels/3.6.2-1.fc16.x86_64/include/linux/unistd.h
/usr/src/kernels/3.6.6-1.fc16.x86_64/arch/x86/include/asm/ia32_unistd.h
/usr/src/kernels/3.6.6-1.fc16.x86_64/arch/x86/include/asm/unistd.h
/usr/src/kernels/3.6.6-1.fc16.x86_64/include/asm-generic/unistd.h
/usr/src/kernels/3.6.6-1.fc16.x86_64/include/linux/unistd.h
[bull:~]$


I opened the first one, /usr/include/unisd.h

Then I searched for "fork", and several matching lines were found.


All times are GMT -5. The time now is 07:35 AM.