Solved

How do I get a child-process's return value

Posted on 2003-11-19
5
1,757 Views
Last Modified: 2009-12-16
This is for a C++ program.

I have a program where I fork and exec to create a child process then waitpid to wait for it to end.  Then I need to get the value the child process returned but I cannot seem to find any system calls to do this.  How do I do this?   (I probably just need the name of the system call, I can probalby take it from there.)
0
Comment
Question by:nietod
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
mtmike earned 100 total points
ID: 9783118
You can use the WEXITSTATUS macro to extract the exit code from the status returned by waitpid()

waitpid(pid, &status, 0);
exitcode = WEXITSTATUS(status);
0
 
LVL 22

Author Comment

by:nietod
ID: 9786748
I'm SOOOOO stupid!!!!!

I don't know how I missed that.


thanks!!!!!
0
 
LVL 22

Author Comment

by:nietod
ID: 9786760
Out of curioisity.   I've been away from EE for a few months now and I'm finidinmg it now has a bizzare layout.  the questions themelfs are scrolled WAY of the right side of the  page.   Are other people experieincing this?  Is this under transition?
0
 
LVL 5

Expert Comment

by:mtmike
ID: 9800345
Under netscape/mozilla, the questions are way on the right side, but konqueror and opera display EE pages normally. IE displays them correctly too.
0
 
LVL 30

Expert Comment

by:Axter
ID: 11017007
If you're having problems using the new look, you can still access the old look by prefixing oldlook.
Example:
http://oldlook.experts-exchange.com:8080/Programming/Programming_Platforms/Linux_Programming/Q_20803247.html
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now