If a child process encounters exit(0) statement, where is this exit status returned in the parent process? Is there any variable associated with every process that holds this information? If not, how do children and parent processes communicate?

Recommended Answers

All 2 Replies

How are you creating the child process? The answer to this question depends on your OS and compiler because managing processes is highly dependent on the system.

I completely agree with deceptikon. For example, in case of Linux you have wait() and waitpid() functions to get the exit status of child process. More on this here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.