comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Start_Process_Search error detection
Date: Thu, 14 Feb 2008 09:26:21 +0100
Date: 2008-02-14T09:26:21+01:00	[thread overview]
Message-ID: <yge3arw54gi.fsf@hugsarin.dmusyd.edu> (raw)
In-Reply-To: xrqdnQ1ik7jg0C_anZ2dnUVZ_tyknZ2d@giganews.com

David Shochat <shochatd@yahoo.com> 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!"



  reply	other threads:[~2008-02-14  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-13  1:53 Start_Process_Search error detection David Shochat
2008-02-14  8:26 ` Jacob Sparre Andersen [this message]
2008-02-14 11:06   ` David Shochat
2008-02-14 15:34     ` Jacob Sparre Andersen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox