Skip navigation.
Home
The QNX Community Portal

View topic - return value of spawnl() function

return value of spawnl() function

For discussion of realtime and/or embedded programming.

return value of spawnl() function

Postby phungha2511 » Mon Jul 18, 2011 8:59 am

Hi every one,

I used spawn() function to execute a child process.

In the document, the return value of spawn() is the exit status of child process(mode P_WAIT, when spawn() return no error), but when I check, it seems the return value is left-shift 8 bits of the exit status of child process.

Are there some mistakes here?

Hagnuyen.
phungha2511
New Member
 
Posts: 3
Joined: Thu May 27, 2010 6:20 am

RE: return value of spawnl() function

Postby mario » Mon Jul 18, 2011 6:59 pm

You need to use the WEXITSTATUS macro to examine it (it basically does a >>8).

Hey Steve are you watching? WEXISTSTATUS is mention in system() but not in spawn*()
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: RE: return value of spawnl() function

Postby stever » Tue Nov 08, 2011 3:38 pm

mario wrote:You need to use the WEXITSTATUS macro to examine it (it basically does a >>8).

Hey Steve are you watching? WEXISTSTATUS is mention in system() but not in spawn*()


A bit late, but yes I am. I'll update the docs.
stever
QNX Master
 
Posts: 106
Joined: Tue Mar 30, 2004 5:04 pm


Return to Realtime and Embedded

Who is online

Users browsing this forum: Google [Bot] and 1 guest