The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Can a child process return a specific value to a parent process ? Ametis1970 High Level Programming 8 04-09-2008 11:22 PM
Child process is not getting started Crab High Level Programming 5 09-17-2006 09:15 PM
about child process compbug UNIX for Dummies Questions & Answers 12 03-22-2006 07:55 PM
gdb to child process shriashishpatil UNIX for Advanced & Expert Users 4 12-12-2005 07:57 AM
KDM child process larryase UNIX for Dummies Questions & Answers 6 01-24-2005 05:41 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-10-2002
skannan skannan is offline
Registered User
  
 

Join Date: Jun 2002
Location: India
Posts: 3
Question Child Process PID

Hi,
Can anybody solve this query?
A parent process forks 2 child processes. How does the child process know it's PID without the parent process sending it.
Apart from the "ps-ef" option, what other options are there if any?
  #2 (permalink)  
Old 06-10-2002
S.P.Prasad S.P.Prasad is offline
Registered User
  
 

Join Date: Jan 2002
Location: India
Posts: 111
As far as command line instruction goes I can only think of 'ps' command along with its various options but programatically each process can call getpid and getppid routines to know its and its parent pid. Moreover the parent process always knows the pids of its child when it spawns a child process.
  #3 (permalink)  
Old 06-10-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
The child process can call getpid().
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0