473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to determine which is the parent process ?

Hi

I had 2 process, eg(AProcess and BProcess). i am invokeing Bprocess from AProcess. How BProcess will determine or identify that Bprocess is invoked by AProcess or some other process. i need a solution that should be in C that can be implement in winodws or linux.

Hope somebody will help me..

thanks in adcance
webdev raj
Jan 24 '08 #1
2 1962
gpraghuram
1,275 Expert 1GB
Hi

I had 2 process, eg(AProcess and BProcess). i am invokeing Bprocess from AProcess. How BProcess will determine or identify that Bprocess is invoked by AProcess or some other process. i need a solution that should be in C that can be implement in winodws or linux.

Hope somebody will help me..

thanks in adcance
webdev raj

Make sure that processA spawns the processB with a specified paramter and in processB check for that parameter.
If it is of the same value then it means it is started by processA.

Check whether this can help you.

Raghuram
Jan 28 '08 #2
Hi

I had 2 process, eg(AProcess and BProcess). i am invokeing Bprocess from AProcess. How BProcess will determine or identify that Bprocess is invoked by AProcess or some other process. i need a solution that should be in C that can be implement in winodws or linux.

Hope somebody will help me..

thanks in adcance
webdev raj

If u r doing this program in Linux/UNIX,
then the Parent Process ID(PPID) value is always less than the Child Process ID.
U can use fork(), etc.
There are so many System Calls are there.
Jan 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Ross Presser | last post by:
OK, I've been researching this problem and can't find a definitive answer yet. The situation is one that seems to have come up a few times to different folks. I am writing an application that...
21
by: Joakim Hove | last post by:
Hello, I have implemented a small library with a function a datatype to manage temporary storage, and handle out correctly casted storage. The function to get a double pointer is for instance: ...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
4
by: Phil Mc | last post by:
Say for example you have a application running on a windows 2003 server (that is on server, not from). This application needs to start child applications (must be stand alone console applications),...
3
by: David Hirschfield | last post by:
I'm launching a process via an os.spawnvp(os.P_NOWAIT,...) call. So now I have the pid of the process, and I want a way to see if that process is complete. I don't want to block on os.waitpid(),...
10
by: John Brown | last post by:
Hi there, Does anyone know how to (generically) determine the currently active form for an application using a "static" function (so I can call it from anywhere). There is no offiical way I've...
2
by: jonasclown | last post by:
HELLU!!!....i'm juan...i'm argentinian....and i'm trying to write some code in "ANSI C" but i need to know if there's a way either through the pipe i created between 2 processes or through the...
1
by: KakaICE | last post by:
Hi, I am using Visual Studio 2005 The problem is: The parent.exe launches a child.exe executible. In the child.exe process I want to know the commandline with which parent.exe was originally...
1
nev
by: nev | last post by:
Good day Sirs & Madams, I know some of you will find this problem very simple. Kindly share a little knowledge to me on how to deal with this. Thank you. I have a parent-child table relation. when...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.