comp.lang.ada
 help / color / mirror / Atom feed
From: Sandy Wise <wise@cs.umass.edu>
Subject: Re: Ada Equivalent of "system()" in C?
Date: 1996/04/22
Date: 1996-04-22T00:00:00+00:00	[thread overview]
Message-ID: <317BC9E4.41C6@cs.umass.edu> (raw)
In-Reply-To: dewar.829741850@schonberg

Here is a bit of POSIX.5 code that I use to model the C system() function.
I have used it successfully under VADS 6.2.3 on the DEC Alpha, and IBM
RS/6000...  Its semantics are close to those documented for the Digital
UNIX version of system().

  Posix_Process_Primitives.Open_Template ( ATemplate );
  Posix.Append ( Args, Posix.To_POSIX_String("-c") );
  Posix.Append ( Args, 
                 Posix.To_POSIX_String( Command ) );
  Posix_Process_Primitives.Start_Process_Search ( 
        PID, Posix.To_POSIX_String("/bin/sh"), ATemplate, Args ); 
  Posix_Process_Primitives.Wait_For_Child_Process ( AStatus, PID );
  Posix_Process_Primitives.Close_Template ( ATemplate );

-- 
Alexander Erskine Wise/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\ WISE@CS.UMASS.EDU /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
/\/\/\/\/\/\/\/\/\/\/\/\/\Laboratory for Advanced Software Engineering Research




  reply	other threads:[~1996-04-22  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-15  0:00 Ada Equivalent of "system()" in C? Dave Sparks
1996-04-16  0:00 ` Robert Dewar
1996-04-17  0:00   ` Samuel Tardieu
1996-04-17  0:00   ` Bob Kitzberger
1996-04-16  0:00     ` David Emery
1996-04-17  0:00       ` Keith Thompson
1996-04-17  0:00       ` Robert Dewar
1996-04-22  0:00         ` Sandy Wise [this message]
1996-04-19  0:00       ` Ron J Theriault
1996-04-16  0:00 ` Samuel Tardieu
replies disabled

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