LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2013, 11:55 AM   #1
sur875
LQ Newbie
 
Registered: Aug 2013
Posts: 1

Rep: Reputation: Disabled
about return value in fork system call


a process runs(using fork system calls),it returns 2 values..how this is possible?
 
Old 08-05-2013, 12:06 PM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 979
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
It's like if you break a magnet in half you don't get separate N and S poles - you get 2 magnets. fork() is supposed to work like that otherwise your processes would lose their sense of direction.

What did you expect?
 
Old 08-05-2013, 12:08 PM   #3
salsalinux
LQ Newbie
 
Registered: May 2013
Location: Utah
Distribution: Mint, Debian, CentOS
Posts: 10

Rep: Reputation: Disabled
Well, if the process Forks, then it is a process and a child process, each requiring an end before returning control to the OS. So that is probably the 2 returns, the parent return, and child return.

What is the program you are running? Or did you program it yourself? Maybe we can test it on another Linux system and see if we get the same results.
 
  


Reply


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
[SOLVED] System Call Return Values jj7 Linux - Newbie 2 05-04-2012 06:32 PM
[SOLVED] php, immediate return from system call? MrUmunhum Programming 1 11-29-2011 05:28 PM
Fork System call bangoram Linux - General 8 07-16-2006 03:24 AM
does a system call return value?? docetes Programming 2 03-16-2006 06:40 PM
Changing the fork system call seshuch Programming 0 10-02-2004 06:18 AM


All times are GMT -5. The time now is 05:33 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration