Re: Start_Process_Search error detection
- From: Jacob Sparre Andersen <sparre@xxxxxx>
- Date: Thu, 14 Feb 2008 09:26:21 +0100
David Shochat <shochatd@xxxxxxxxx> writes:
Posix/Ada, package Posix_Process_Primitives, includes a procedure
Start_Process_Search which searches for the requested program using
the value of the PATH environment variable. My question is, how do
you detect that the search failed (or will fail)? The package spec
we have is virtually devoid of documentation. Checking the returned
process id does not work. I get a nonzero process id even when I
pass a fictitious name. Also, no exception is raised. I could parse
$PATH and check each directory, but there must be a better way. This
is Apex on Solaris.
I haven't got any documentation either, but the Florist implementation
of POSIX.Process_Primitives.Start_Process_Search will give you a
negative value in the formal parameter Child, if the creation of a new
process failed. If the creation didn't fail, you can use
POSIX.Process_Primitives.Wait_For_Chilt_Process to see if the child
process exited with the status Failed_Creation_Exit.
Greetings,
Jacob
--
"The early bird may get the worm, but the second mouse gets the cheese!"
.
- Follow-Ups:
- Re: Start_Process_Search error detection
- From: David Shochat
- Re: Start_Process_Search error detection
- References:
- Start_Process_Search error detection
- From: David Shochat
- Start_Process_Search error detection
- Prev by Date: Re: Reducing the size of executables produced by GNAT
- Next by Date: Re: Reducing the size of executables produced by GNAT
- Previous by thread: Start_Process_Search error detection
- Next by thread: Re: Start_Process_Search error detection
- Index(es):
Relevant Pages
|