Commit 8967c38f by Vincent Celier Committed by Arnaud Charlet

g-os_lib.ads, [...] (Locate_Exec_On_Path): Always return an absolute path name.

2006-10-31  Vincent Celier  <celier@adacore.com>

	* g-os_lib.ads, g-os_lib.adb (Locate_Exec_On_Path): Always return an
	absolute path name.
	(Locate_Regular_File): Ditto
	(Change_Dir): Remove, no longer used
	(Normalize_Pathname): Do not use Change_Dir to get the drive letter
	on Windows. Get it calling Get_Current_Dir.
	(OpenVMS): Remove imported boolean, no longer needed.
	(Normalize_Pathname)[VMS]: Do not resolve directory names.
	(Pid_To_Integer): New function to convert a Process_Id to  Integer

From-SVN: r118279
parent ac36caab
...@@ -198,7 +198,7 @@ package GNAT.OS_Lib is ...@@ -198,7 +198,7 @@ package GNAT.OS_Lib is
-- for subsequent use in Write calls. File descriptor returned is -- for subsequent use in Write calls. File descriptor returned is
-- Invalid_FD if file cannot be successfully created. -- Invalid_FD if file cannot be successfully created.
function Create_Output_Text_File (Name : String) return File_Descriptor; function Create_Output_Text_File (Name : String) return File_Descriptor;
-- Creates new text file with given name suitable to redirect standard -- Creates new text file with given name suitable to redirect standard
-- output, returning file descriptor. File descriptor returned is -- output, returning file descriptor. File descriptor returned is
-- Invalid_FD if file cannot be successfully created. -- Invalid_FD if file cannot be successfully created.
...@@ -600,8 +600,7 @@ package GNAT.OS_Lib is ...@@ -600,8 +600,7 @@ package GNAT.OS_Lib is
function Locate_Regular_File function Locate_Regular_File
(File_Name : C_File_Name; (File_Name : C_File_Name;
Path : C_File_Name) Path : C_File_Name) return String_Access;
return String_Access;
------------------ ------------------
-- Subprocesses -- -- Subprocesses --
...@@ -667,8 +666,7 @@ package GNAT.OS_Lib is ...@@ -667,8 +666,7 @@ package GNAT.OS_Lib is
function Spawn function Spawn
(Program_Name : String; (Program_Name : String;
Args : Argument_List) Args : Argument_List) return Integer;
return Integer;
-- Similar to the above procedure, but returns the actual status returned -- Similar to the above procedure, but returns the actual status returned
-- by the operating system, or -1 under VxWorks and any other similar -- by the operating system, or -1 under VxWorks and any other similar
-- operating systems which have no notion of separately spawnable programs. -- operating systems which have no notion of separately spawnable programs.
...@@ -707,16 +705,19 @@ package GNAT.OS_Lib is ...@@ -707,16 +705,19 @@ package GNAT.OS_Lib is
type Process_Id is private; type Process_Id is private;
-- A private type used to identify a process activated by the following -- A private type used to identify a process activated by the following
-- non-blocking call. The only meaningful operation on this type is a -- non-blocking calls. The only meaningful operation on this type is a
-- comparison for equality. -- comparison for equality.
Invalid_Pid : constant Process_Id; Invalid_Pid : constant Process_Id;
-- A special value used to indicate errors, as described below -- A special value used to indicate errors, as described below
function Pid_To_Integer (Pid : Process_Id) return Integer;
-- Convert a process id to an Integer. Useful for writing hash functions
-- for type Process_Id or to compare two Process_Id (e.g. for sorting).
function Non_Blocking_Spawn function Non_Blocking_Spawn
(Program_Name : String; (Program_Name : String;
Args : Argument_List) Args : Argument_List) return Process_Id;
return Process_Id;
-- This is a non blocking call. The Process_Id of the spawned process is -- This is a non blocking call. The Process_Id of the spawned process is
-- returned. Parameters are to be used as in Spawn. If Invalid_Pid is -- returned. Parameters are to be used as in Spawn. If Invalid_Pid is
-- returned the program could not be spawned. -- returned the program could not be spawned.
...@@ -745,8 +746,7 @@ package GNAT.OS_Lib is ...@@ -745,8 +746,7 @@ package GNAT.OS_Lib is
(Program_Name : String; (Program_Name : String;
Args : Argument_List; Args : Argument_List;
Output_File : String; Output_File : String;
Err_To_Out : Boolean := True) Err_To_Out : Boolean := True) return Process_Id;
return Process_Id;
-- Similar to the procedure above, but saves the output of the command to -- Similar to the procedure above, but saves the output of the command to
-- a file with the name Output_File. -- a file with the name Output_File.
-- --
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment