From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f4e8c6faa68f2ed1 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Start_Process_Search error detection Date: Thu, 14 Feb 2008 09:26:21 +0100 Organization: Jacob's private Usenet server Message-ID: References: NNTP-Posting-Host: taasingegade.news.jacob-sparre.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: jacob-sparre.dk 1202977581 21250 85.82.239.166 (14 Feb 2008 08:26:21 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 14 Feb 2008 08:26:21 +0000 (UTC) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:Wz0SaUet/NDcsuHIZH/kRJ+KaU8= Xref: g2news1.google.com comp.lang.ada:19787 Date: 2008-02-14T09:26:21+01:00 List-Id: David Shochat 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!"