timed wait for process termination?

QNX 6.2: Is there a way to wait for a process to terminate using a timeout?
I can do a waitpid() with an option of WEXITED but that appears to wait
forever. I want something like that but I want to specify a timeout on the
wait. Or will I have to setup a timer myself to signal me when the timeout
is reached?

Thanx,
Dave G.

See TimerTimeout().

-Adam
Dave G. <~~~dkg@ormec.com> wrote in message news:b3lff0$k21$1@inn.qnx.com

QNX 6.2: Is there a way to wait for a process to terminate using a
timeout?
I can do a waitpid() with an option of WEXITED but that appears to wait
forever. I want something like that but I want to specify a timeout on
the
wait. Or will I have to setup a timer myself to signal me when the
timeout
is reached?

Thanx,
Dave G.

OK Thanx… I was blinded by my desire to stick with Posix calls.

Dave G.

“Adam Mallory” <amallory@qnx.com> wrote in message
news:b3lhnn$827$1@nntp.qnx.com

See TimerTimeout().

-Adam
Dave G. <~~~> dkg@ormec.com> > wrote in message
news:b3lff0$k21$> 1@inn.qnx.com> …
QNX 6.2: Is there a way to wait for a process to terminate using a
timeout?
I can do a waitpid() with an option of WEXITED but that appears to wait
forever. I want something like that but I want to specify a timeout on
the
wait. Or will I have to setup a timer myself to signal me when the
timeout
is reached?

Thanx,
Dave G.
\

alarm() :wink:

-Adam
Dave G. <~~~dkg@ormec.com> wrote in message news:b3ln57$s3m$1@inn.qnx.com

OK Thanx… I was blinded by my desire to stick with Posix calls.

Dave G.

“Adam Mallory” <> amallory@qnx.com> > wrote in message
news:b3lhnn$827$> 1@nntp.qnx.com> …

See TimerTimeout().

-Adam
Dave G. <~~~> dkg@ormec.com> > wrote in message
news:b3lff0$k21$> 1@inn.qnx.com> …
QNX 6.2: Is there a way to wait for a process to terminate using a
timeout?
I can do a waitpid() with an option of WEXITED but that appears to
wait
forever. I want something like that but I want to specify a timeout
on
the
wait. Or will I have to setup a timer myself to signal me when the
timeout
is reached?

Thanx,
Dave G.


\

Yes, that was what I was looking at when I first posted my message.
However, we have a need to wait with sub-second resolution. Actually, I
doubt we really do but the library I am porting uses mSecs for a timeout
parm when waiting for a thread to exit. I know I can create a timer and do
it manually, I was just hoping for a timedwait type of call.

Sorry for the noobie types of questions I have but I gotta learn somehow :wink:

Dave G.

“Adam Mallory” <amallory@qnx.com> wrote in message
news:b3ltr1$fkt$1@nntp.qnx.com

alarm() > :wink:

-Adam
Dave G. <~~~> dkg@ormec.com> > wrote in message
news:b3ln57$s3m$> 1@inn.qnx.com> …
OK Thanx… I was blinded by my desire to stick with Posix calls.

Dave G.

“Adam Mallory” <> amallory@qnx.com> > wrote in message
news:b3lhnn$827$> 1@nntp.qnx.com> …

See TimerTimeout().

-Adam
Dave G. <~~~> dkg@ormec.com> > wrote in message
news:b3lff0$k21$> 1@inn.qnx.com> …
QNX 6.2: Is there a way to wait for a process to terminate using a
timeout?
I can do a waitpid() with an option of WEXITED but that appears to
wait
forever. I want something like that but I want to specify a timeout
on
the
wait. Or will I have to setup a timer myself to signal me when the
timeout
is reached?

Thanx,
Dave G.




\

Dave G. <~~~dkg@ormec.com> wrote:

Yes, that was what I was looking at when I first posted my message.
However, we have a need to wait with sub-second resolution. Actually, I
doubt we really do but the library I am porting uses mSecs for a timeout
parm when waiting for a thread to exit. I know I can create a timer and do
it manually, I was just hoping for a timedwait type of call.

Sorry for the noobie types of questions I have but I gotta learn somehow > :wink:

Since you can get a SIGCHLD when a child process terminates, you could
use that plus sigtimedwait() to wait for the SIGCHLD or the timeout then,
if you got the signal, do the wait() knowing that you won’t block.


Brian Stecher (bstecher@qnx.com) QNX Software Systems, Ltd.
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8