LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-16-2012, 05:13 AM   #1
sachinchhatna
LQ Newbie
 
Registered: Jun 2012
Posts: 19

Rep: Reputation: Disabled
Question 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
 
Old 11-16-2012, 05:23 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Quote:
Originally Posted by sachinchhatna View Post
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.
 
2 members found this post helpful.
Old 11-19-2012, 08:01 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: India
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,320

Rep: Reputation: 62
WHY do you want the fork source code?
 
Old 11-19-2012, 01:11 PM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,441

Rep: Reputation: 81
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.

Last edited by fakie_flip; 11-19-2012 at 01:15 PM.
 
  


Reply

Tags
kernel source


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GPL code vs my private source code???? DennisC31 Linux - General 7 03-08-2011 10:24 AM
Where in the source code do I find the source for the Cisco FCoE HBA Drvr? madcowtricks Slackware 6 01-27-2011 03:00 PM
[SOLVED] why I couldn't find the source code of printf function in glibc source? famsinyi Programming 5 09-21-2009 09:06 AM
Help with C code for detecting ext4 in VisParted (fork of GParted) Patrick Verner Programming 6 03-03-2008 08:00 PM
Samba Code Fork Announced jeremy Linux - General 6 10-17-2000 06:16 PM


All times are GMT -5. The time now is 03:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration