diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:41:09 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-16 08:41:09 +0000 |
commit | 187e7e88fc94cdc8f22d2d794d7151a0e6e2a923 (patch) | |
tree | 193e0301b2a417b9c7fc2fb80f6847496c0ebdef /gcc/ada/g-os_lib.ads | |
parent | a691a9d823d4df7462ece84f208187705f106dc4 (diff) | |
download | gcc-187e7e88fc94cdc8f22d2d794d7151a0e6e2a923.tar.gz |
2005-06-14 Vincent Celier <celier@adacore.com>
Cyrille Comar <comar@adacore.com>
* g-os_lib.ads, g-os_lib.adb (Non_Blocking_Spawn): Two new versions
with output file descriptor and with output file name.
(Dup, Dup2): Now global procedures as they are used by two subprograms
(Copy): Allocate the 200K buffer on the heap rather than on the stack.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-os_lib.ads')
-rw-r--r-- | gcc/ada/g-os_lib.ads | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ada/g-os_lib.ads b/gcc/ada/g-os_lib.ads index fa094b088c7..5c67c7ad7a7 100644 --- a/gcc/ada/g-os_lib.ads +++ b/gcc/ada/g-os_lib.ads @@ -114,7 +114,6 @@ package GNAT.OS_Lib is subtype Second_Type is Integer range 0 .. 59; -- Declarations similar to those in Calendar, breaking down the time - function GM_Year (Date : OS_Time) return Year_Type; function GM_Month (Date : OS_Time) return Month_Type; function GM_Day (Date : OS_Time) return Day_Type; @@ -715,6 +714,41 @@ package GNAT.OS_Lib is -- This function will always return Invalid_Id under VxWorks, since there -- is no notion of executables under this OS. + function Non_Blocking_Spawn + (Program_Name : String; + Args : Argument_List; + Output_File_Descriptor : File_Descriptor; + Err_To_Out : Boolean := True) + return Process_Id; + -- Similar to the procedure above, but redirects the output to the file + -- designated by Output_File_Descriptor. If Err_To_Out is True, then the + -- Standard Error output is also redirected. Invalid_Id is returned + -- if the program could not be spawned successfully. + -- + -- "Non_Blocking_Spawn" should not be used in tasking applications. + -- + -- This function will always return Invalid_Id under VxWorks, since there + -- is no notion of executables under this OS. + + function Non_Blocking_Spawn + (Program_Name : String; + Args : Argument_List; + Output_File : String; + Err_To_Out : Boolean := True) + return Process_Id; + -- Similar to the procedure above, but saves the output of the command to + -- a file with the name Output_File. + -- + -- Success is set to True if the command is executed and its output + -- successfully written to the file. Invalid_Id is returned if the output + -- file could not be created or if the program could not be spawned + -- successfully. + -- + -- "Non_Blocking_Spawn" should not be used in tasking applications. + -- + -- This function will always return Invalid_Id under VxWorks, since there + -- is no notion of executables under this OS. + procedure Wait_Process (Pid : out Process_Id; Success : out Boolean); -- Wait for the completion of any of the processes created by previous -- calls to Non_Blocking_Spawn. The caller will be suspended until one of |