comp.lang.ada
 help / color / mirror / Atom feed
From: Michael Reed <mreed@hercii.mar.lmco.com>
Subject: Getting environment values in POSIX from terminated child process
Date: 1998/08/04
Date: 1998-08-04T00:00:00+00:00	[thread overview]
Message-ID: <35C7583C.E71DBC7D@hercii.mar.lmco.com> (raw)

In Rational Apex, I've been utilizing a simple series of POSIX
calls to execute UNIX scripts from within an ada program
(I figured them out from an amalgam of previous postings to this group,
particularly Kenneth Almquist's posting of how to execute a
system command using POSIX.
thank you! by the way...):

The main calls within this procedure are:
Start_Process(Child, "/bin/sh", Template, Arguments);

followed by a
Wait_For_Child_Process(Proc_Status, Child, Trace_Stopped => False,
  Masked_signals => All_Signals);

What I was wondering was, after the completion of the process, is there
any way I can still get my hands on the environment variables associated
with that process?  Is there some function call I can make on
Proc_Status for instance (a Termination_Status variable by the way) that
will return me the final environment associated with that process?

The reason I'm trying to figure this out is that I want to be able to
pass information from my script back to my program.  At the moment the
only way I know how to do that is to alter the error codes that are
coming back... but I would prefer that the error status was used
exclusively to return info on whether the process terminated abnormally
or not.  I thought that if I could put the relevant results into various
environment variables and then access them from my ada program, it would
be a more flexible way of passing information.

Any suggestions?

Michael Reed






             reply	other threads:[~1998-08-04  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-04  0:00 Michael Reed [this message]
1998-08-08  0:00 ` Getting environment values in POSIX from terminated child process Lieven Marchand
replies disabled

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