Hi,
I have a problem to check for process availability in a CRT based application.
I'm using:
pid = _spawnlp (_P_NOWAIT, cmd, buf->data, NULL)
to start a background process and need help to check if the initialisation
of the process fails.
_spawnlp allready return an error if something happen during startup like cmd is missing
but i want to wait for ~ 0.1 sec and just check for the pid still exists. the problem is that
_cwait is blocking until the process is finished. under unix I'm using:
waitpid (pid, NULL, WNOHANG)
with:
WNOHANG The waitpid() function will not suspend exe-
cution of the calling process if status is
not immediately available for one of the
child processes specified by pid.
how can I check I the process still exists with only the pid as argument
-> thanks for help
mfg
Andreas Otto