PowerAda Specifications for Posix Ada Packages
From OC Systems Wiki!
< PowerAda:APPENDIX B. Support Packages
Revision as of 02:45, 24 April 2019 by imported>WikiVisor
The remainder of this appendix includes the specifications for the Ada83/Ada95 implementation of the POSIX/Ada Packages.
The disclaimer at the beginning applies to all the source that follows. Also, note that these are based on the specification IEEE Std 1003.5-1992 rather than the newer IEEE Std 1003.6-1996, although the specifications of these packages are very similar.
Contents
- 1 Disclaimer
- 2 POSIX
- 3 POSIX_Process_Primitives
- 4 POSIX_Unsafe_Process_Primitives
- 5 POSIX_Signals
- 6 POSIX_Process_Identification
- 7 POSIX_Process_Times
- 8 POSIX_Process_Environment
- 9 POSIX_Calendar
- 10 POSIX_Configurable_System_Limits
- 11 POSIX_Permissions
- 12 POSIX_Files
- 13 POSIX_File_Status
- 14 POSIX_Configurable_File_Limits
- 15 POSIX_IO
- 16 POSIX_File_Locking
- 17 POSIX_Terminal_Functions
- 18 POSIX_Supplement_to_Ada_IO
- 19 POSIX_User_Database
- 20 POSIX_Group_Database
Disclaimer
------------------------------------------------------------------------
-- These package specifications were extracted from IEEE Std 1003.5-1992,
-- IEEE Standard for Information Technology--POSIX Ada Language
-- Interfaces--Part 1: Binding System Application Program Interface,
-- copyright (c)1992 by the Institute of Electrical and Electronics
-- Engineers, Inc. These package specifications represent only a portion
-- of the document and are not to be interpreted as the approved
-- consensus standard. The IEEE Std 1003.5-1992 must be used in
-- conjunction with these package specifications in order to claim
-- conformance. The IEEE takes no responsibility for and will assume no
-- liability for damages resulting from the reader's misinterpreting of
-- said information resulting from its out of context nature. To order
-- copies of the IEEE Std 1003.5-1992, please contact the IEEE Service
-- Center at 445 Hoes Lane, PO Box 1331, Piscataway, NJ 08855-1331; via
-- phone at 1-800-678-IEEE, 908-981-1393; or via fax at 908-981-9667.
------------------------------------------------------------------------
POSIX
with <implementation-defined>;
package POSIX is
-- Symbolic subtypes and constants
-- Optional Facilities
subtype Job_Control_Support is Boolean range True .. True;
subtype Saved_IDs_Support is Boolean range True .. True;
subtype Change_Owner_Restriction is Boolean range True .. True;
subtype Filename_Truncation is Boolean range False .. False;
System_POSIX_Version : constant := 1990_09;
POSIX_Ada_Version : constant := 1992_06;
-- I/O Count
type IO_Count is range 0..16#7FFF_FFFF#;
subtype IO_Count_Maxima is IO_Count range 32767..IO_Count'Last;
-- System Limits
Portable_Groups_Maximum : constant Natural := 0;
subtype Groups_Maxima is Natural range 0 .. 32;
Portable_Argument_List_Maximum : constant Natural := 4096;
subtype Argument_List_Maxima is Natural range 4096 .. 24576;
Portable_Child_Processes_Maximum : constant Natural := 6;
subtype Child_Processes_Maxima is Natural range 6 .. 40;
Portable_Open_Files_Maximum : constant Natural := 16;
subtype Open_Files_Maxima is Natural range 16 .. 2000;
Portable_Stream_Maximum : constant Natural := 8;
subtype Stream_Maxima is Natural range 8 .. 2000;
Portable_Time_Zone_String_Maximum : constant Natural := 3;
subtype Time_Zone_String_Maxima is Natural range 3 .. 255;
-- Pathname Variable Values
Portable_Link_Limit_Maximum : constant Natural := 8;
subtype Link_Limit_Maxima is Natural range 8 .. 32767;
Portable_Input_Line_Limit_Maximum : constant IO_Count := 255;
subtype Input_Line_Limit_Maxima is IO_Count range 255 .. 256;
Portable_Input_Queue_Limit_Maximum : constant IO_Count := 255;
subtype Input_Queue_Limit_Maxima is IO_Count range 255 .. 512;
Portable_Filename_Limit_Maximum : constant Natural := 14;
subtype Filename_Limit_Maxima is Natural range 14 .. 255;
Portable_Pathname_Limit_Maximum : constant Natural := 255;
subtype Pathname_Limit_Maxima is Natural range 255 .. 1023;
Portable_Pipe_Limit_Maximum : constant IO_Count := 512;
subtype Pipe_Limit_Maxima is IO_Count range 512 .. 32768;
-- Blocking Behavior Values
type Blocking_Behavior is (Tasks, Program);
subtype Text_IO_Blocking_Behavior is Blocking_Behavior
range Program .. Program;
IO_Blocking_Behavior : constant Blocking_Behavior := Program;
File_Lock_Blocking_Behavior : constant Blocking_Behavior := Program;
Wait_For_Child_Blocking_Behavior : constant Blocking_Behavior := Program;
-- Signal Masking
type Signal_Masking is (No_Signals, RTS_Signals, All_Signals);
-- Characters and Strings
type POSIX_Character is new Character;
for POSIX_Character'Size use 8;
-- ** Ada83 definition **
-- type POSIX_Character is
-- ( NUL, SOH, STX, ETX, EOT, ENQ, ACK, BEL,
-- BS, HT, LF, VT, FF, CR, SO, SI,
-- DLE, DC1, DC2, DC3, DC4, NAK, SYN, ETB,
-- CAN, EM, SUB, ESC, FS, GS, RS, US,
--
-- ' ', '!', '"', '#', '$', '%', '&', ''',
-- '(', ')', '*', '+', ',', '-', '.', '/',
-- '0', '1', '2', '3', '4', '5', '6', '7',
-- '8', '9', ':', ';', '<', '=', '>', '?',
--
-- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',
-- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
-- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
-- 'X', 'Y', 'Z', '[', '\', ']', '^', '_',
--
-- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
-- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
-- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
-- 'x', 'y', 'z', '{', '|', '}', '~', DEL,
--
-- C128, C129, C130, C131, C132, C133, C134, C135,
-- C136, C137, C138, C139, C140, C141, C142, C143,
-- C144, C145, C146, C147, C148, C149, C150, C151,
-- C152, C153, C154, C155, C156, C157, C158, C159,
--
-- C160, C161, C162, C163, C164, C165, C166, C167,
-- C168, C169, C170, C171, C172, C173, C174, C175,
-- C176, C177, C178, C179, C180, C181, C182, C183,
-- C184, C185, C186, C187, C188, C189, C190, C191,
--
-- C192, C193, C194, C195, C196, C197, C198, C199,
-- C200, C201, C202, C203, C204, C205, C206, C207,
-- C208, C209, C210, C211, C212, C213, C214, C215,
-- C216, C217, C218, C219, C220, C221, C222, C223,
--
-- C224, C225, C226, C227, C228, C229, C230, C231,
-- C232, C233, C234, C235, C236, C237, C238, C239,
-- C240, C241, C242, C243, C244, C245, C246, C247,
-- C248, C249, C250, C251, C252, C253, C254, C255 );
-- for POSIX_Character'Size use 8;
type POSIX_String is array (Positive range <>) of POSIX_Character;
function To_POSIX_String (Str : string) return POSIX_String;
function To_String (Str : POSIX_String) return string;
subtype Filename is POSIX_String;
subtype Pathname is POSIX_String;
function Is_Filename (Str : POSIX_String) return Boolean;
function Is_Pathname (Str : POSIX_String) return Boolean;
function Is_Portable_Filename (Str : POSIX_String) return Boolean;
function Is_Portable_Pathname (Str : POSIX_String) return Boolean;
-- String Lists
type POSIX_String_List is limited private;
Empty_String_List : constant POSIX_String_List;
procedure Make_Empty (List : in out POSIX_String_List);
procedure Append (List : in out POSIX_String_List;
Str : in POSIX_String);
generic
with procedure Action
(Item : in POSIX_String;
Quit : in out Boolean);
procedure For_Every_Item (List : in POSIX_String_List);
function Length (List : POSIX_String_List) return Natural;
function Value (List : POSIX_String_List; Index : Positive)
return POSIX_String;
-- option sets
type Option_Set is private;
function Empty_Set return Option_Set;
function "+" (L, R : Option_Set) return Option_Set;
function "-" (L, R : Option_Set) return Option_Set;
-- Exceptions and error codes
POSIX_Error: exception;
type Error_Code is range 0 .. 255;
for Error_Code'Size use 32;
function Get_Error_Code return Error_Code;
procedure Set_Error_Code (Error: in Error_Code);
function Is_POSIX_Error (Error: Error_Code) return Boolean;
function Image (Error: Error_Code) return String;
No_Error : constant Error_Code := 0;
Argument_List_Too_Long : constant Error_Code := 7; -- E2BIG
Bad_File_Descriptor : constant Error_Code := 9; -- EBADF
Broken_Pipe : constant Error_Code := 32; -- EPIPE
Directory_Not_Empty : constant Error_Code := 87; -- ENOTEMPTY
Exec_Format_Error : constant Error_Code := 8; -- ENOEXEC
File_Exists : constant Error_Code := 17; -- EEXIST
File_Too_Large : constant Error_Code := 27; -- EFBIG
Filename_Too_Long : constant Error_Code := 86; -- ENAMETOOLONG
Improper_Link : constant Error_Code := 18; -- EXDEV;
Inappropriate_IO_Control_Operation
: constant Error_Code := 25; -- ENOTTY;
Input_Output_Error : constant Error_Code := 5; -- EIO;
Interrupted_Operation : constant Error_Code := 4; -- EINTR;
Invalid_Argument : constant Error_Code := 22; -- EINVAL;
Invalid_Seek : constant Error_Code := 29; -- ESPIPE;
Is_A_Directory : constant Error_Code := 21; -- EISDIR;
No_Child_Process : constant Error_Code := 10; -- ECHILD;
No_Locks_Available : constant Error_Code := 49; -- ENOLCK;
No_Space_Left_On_Device : constant Error_Code := 28; -- ENOSPC;
No_Such_Operation_On_Device : constant Error_Code := 19; -- ENODEV;
No_Such_Device_Or_Address : constant Error_Code := 6; -- ENXIO;
No_Such_File_Or_Directory : constant Error_Code := 2; -- ENOENT;
No_Such_Process : constant Error_Code := 3; -- ESRCH;
Not_A_Directory : constant Error_Code := 20; -- ENOTDIR;
Not_Enough_Space : constant Error_Code := 12; -- ENOMEM;
Operation_Not_Implemented : constant Error_Code := 109; -- ENOSYS;
Operation_Not_Permitted : constant Error_Code := 1; -- EPERM;
Permission_Denied : constant Error_Code := 13; -- EACCES;
Read_Only_File_System : constant Error_Code := 30; -- EROFS;
Resource_Busy : constant Error_Code := 16; -- EBUSY;
Resource_Deadlock_Avoided : constant Error_Code := 45; -- EDEADLK;
Resource_Temporarily_Unavailable
: constant Error_Code := 11; -- EAGAIN, EWOULDBLOCK
Too_Many_Links : constant Error_Code := 31; -- EMLINK;
Too_Many_Open_Files : constant Error_Code := 24; -- EMFILE;
Too_Many_Open_Files_In_System : constant Error_Code := 24; -- ENFILE;
-- System Identification
function System_Name return POSIX_String;
function Node_Name return POSIX_String;
function Release return POSIX_String;
function Version return POSIX_String;
function Machine return POSIX_String;
private
<implementation-defined>
end POSIX;
POSIX_Process_Primitives
with POSIX,
POSIX_IO,
POSIX_Permissions,
POSIX_Process_Environment,
POSIX_Process_Identification,
POSIX_Signals;
package POSIX_Process_Primitives is
-- Process Template
type Process_Template is limited private;
procedure Open_Template (Template : in out Process_Template);
procedure Close_Template (Template : in out Process_Template);
procedure Set_Keep_Effective_IDs
(Template : in out Process_Template);
procedure Set_Signal_Mask
(Template : in out Process_Template;
Mask : in POSIX_Signals.Signal_Set);
procedure Set_Creation_Signal_Masking
(Template : in out Process_Template;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
procedure Set_File_Action_To_Close
(Template : in out Process_Template;
File : in POSIX_IO.File_Descriptor);
procedure Set_File_Action_To_Open
(Template : in out Process_Template;
File : in POSIX_IO.File_Descriptor;
Name : in POSIX.Pathname;
Mode : in POSIX_IO.File_Mode
:= POSIX_IO.Read_Only;
Options : in POSIX_IO.Open_Option_Set
:= POSIX_IO.Empty_Set);
procedure Set_File_Action_To_Duplicate
(Template : in out Process_Template;
File : in POSIX_IO.File_Descriptor;
From_File : in POSIX_IO.File_Descriptor);
-- Process Creation
procedure Start_Process
(Child : out POSIX_Process_Identification.Process_ID;
Pathname : in POSIX.Pathname;
Template : in Process_template;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
procedure Start_Process
(Child : out POSIX_Process_Identification.Process_ID;
Pathname : in POSIX.Pathname;
Template : in Process_Template;
Env_List : in POSIX_Process_Environment.Environment;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
procedure Start_Process_Search
(Child : out POSIX_Process_Identification.Process_ID;
Filename : in POSIX.Filename;
Template : in Process_Template;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
procedure Start_Process_Search
(Child : out POSIX_Process_Identification.Process_ID;
Filename : in POSIX.Filename;
Template : in Process_Template;
Env_List : in POSIX_Process_Environment.Environment;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
-- Process Exit
type Exit_Status is range 0 .. 2**8-1;
Normal_Exit : constant Exit_Status := 0;
Failed_Creation_Exit : constant Exit_Status := 41;
Unhandled_Exception_Exit : constant Exit_Status := 42;
procedure Exit_Process (Status : in Exit_Status := Normal_Exit);
-- Termination Status
type Termination_Status is private;
type Termination_Cause is
(Exited, Terminated_By_Signal, Stopped_By_Signal);
function Status_Available (Status : Termination_Status)
return Boolean;
function Process_ID_Of (Status : Termination_Status)
return POSIX_Process_Identification.Process_ID;
function Termination_Cause_Of (Status : Termination_Status)
return Termination_Cause;
function Exit_Status_Of (Status : Termination_Status)
return Exit_Status;
function Termination_Signal_Of (Status : Termination_Status)
return POSIX_Signals.Signal;
function Stopping_Signal_Of (Status : Termination_Status)
return POSIX_Signals.Signal;
-- Wait for Process Termination
procedure Wait_For_Child_Process
(Status : out Termination_Status;
Child : in POSIX_Process_Identification
.Process_ID;
Block : in Boolean := True;
Trace_Stopped : in Boolean := True;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
procedure Wait_for_Child_Process
(Status : out Termination_Status;
Group : in POSIX_Process_Identification
.Process_Group_ID;
Block : in Boolean := True;
Trace_Stopped : in Boolean := True;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
procedure Wait_for_Child_Process
(Status : out Termination_Status;
Block : in Boolean := True;
Trace_Stopped : in Boolean := True;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
private
<implementation-defined>
end POSIX.Process_Primitives;
POSIX_Unsafe_Process_Primitives
with POSIX,
POSIX_Process_Environment,
POSIX_Process_Indentification;
package POSIX.Unsafe_Process_Primitives is
-- Process Creation
function Fork
return POSIX_Process_Indentification.Process_ID;
-- File Execution
procedure Exec
(Pathname : in POSIX.Pathname;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List;
Env_List : in POSIX_Process_Environment.Environment);
procedure Exec
(Pathname : in POSIX.Pathname;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
procedure Exec_Search
(Filename : in POSIX.Filename;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List;
Env_List : in POSIX_Process_Environment.Environment);
procedure Exec_Search
(Filename : in POSIX.Filename;
Arg_List : in POSIX.POSIX_String_List
:= POSIX.Empty_String_List);
end POSIX.Unsafe_Process_Primitives;
POSIX_Signals
with POSIX,
POSIX_Process_Indentification;
with <implementation-defined>;
package POSIX_Signals is
-- Signal Type
type Signal is new Ada.Interrupts.Interrupt_ID;
-- ** In Ada83, this is:
-- type Signal is new Int range 0 .. 63;
function Image(Sig : Signal)
return String;
function Value(Str : String)
return Signal;
-- Standard Signals (required)
Signal_Null, SIGNULL : constant Signal;
Signal_Abort, SIGABRT : constant Signal;
Signal_Alarm, SIGALRM : constant Signal;
Signal_Floating_Point_Error,
SIGFPE : constant Signal;
Signal_Hangup, SIGHUP : constant Signal;
Signal_Illegal_Instruction,
SIGILL : constant Signal;
Signal_Interrupt, SIGINT : constant Signal;
Signal_Kill, SIGKILL : constant Signal;
Signal_Pipe_Write, SIGPIPE : constant Signal;
Signal_Quit, SIGQUIT : constant Signal;
Signal_Segmentation_Violation,
SIGSEGV : constant Signal;
Signal_Terminate, SIGTERM : constant Signal;
Signal_User_1, SIGUSR1 : constant Signal;
Signal_User_2, SIGUSR2 : constant Signal;
-- Standard Signals (job control)
Signal_Child, SIGCHLD : constant Signal;
Signal_Continue, SIGCONT : constant Signal;
Signal_Stop, SIGSTOP : constant Signal;
Signal_Terminal_Stop, SIGTSTP : constant Signal;
Signal_Terminal_Input,
SIGTTIN : constant Signal;
Signal_Terminal_Output,
SIGTTOU : constant Signal;
-- Signal Handler References
Signal_Abort_Ref : constant System.Address;
-- Signal_Alarm intentionally omitted.
-- Signal_Floating_Point_Error intentionally omitted.
Signal_Hangup_Ref : constant System.Address;
-- Signal_Illegal_Instruction intentionally omitted.
Signal_Interrupt_Ref : constant System.Address;
-- Signal_Kill intentionally omitted.
Signal_Pipe_Write_Ref : constant System.Address;
Signal_Quit_Ref : constant System.Address;
-- Signal_Segmentation_Violation intentionally omitted.
Signal_Terminate_Ref : constant System.Address;
Signal_User_1_Ref : constant System.Address;
Signal_User_2_Ref : constant System.Address;
Signal_Child_Ref : constant System.Address;
Signal_Continue_Ref : constant System.Address;
-- Signal_Stop intentionally omitted.
Signal_Terminal_Stop_Ref : constant System.Address;
Signal_Terminal_Input_Ref : constant System.Address;
Signal_Terminal_Output_Ref : constant System.Address;
-- Signal Sets
type Signal_Set is private;
procedure Add_Signal
(Set : in out Signal_Set;
Sig : in Signal);
procedure Add_All_Signals (Set : in out Signal_Set);
procedure Delete_Signal
(Set : in out Signal_Set;
Sig : in Signal);
procedure Delete_All_Signals (Set : in out Signal_Set);
function Is_Member
(Set : Signal_Set;
Sig : Signal)
return Boolean;
-- Sending a Signal
procedure Send_Signal
(Process : in POSIX_Process_Indentification.Process_ID;
Sig : in Signal);
procedure Send_Signal
(Group : in POSIX_Process_Indentification.Process_Group_ID;
Sig : in Signal);
procedure Send_Signal (Sig : in Signal);
-- Blocking and Unblocking Signals
procedure Set_Blocked_Signals
(New_Mask : in Signal_Set;
Old_Mask : out Signal_Set);
procedure Block_Signals
(Mask_to_Add : in Signal_Set;
Old_Mask : out Signal_Set);
procedure Unblock_Signals
(Mask_to_Subtract : in Signal_Set;
Old_Mask : out Signal_Set);
function Blocked_Signals
return Signal_Set;
-- Ignoring Signals
procedure Ignore_Signal (Sig : in Signal);
procedure Unignore_Signal (Sig : in Signal);
function Is_Ignored (Sig : Signal)
return Boolean;
-- Controlling Delivery of Signal_Child Signal
procedure Set_Stopped_Child_Signal
(Enable : in Boolean := True);
function Stopped_Child_Signal_Enabled
return Boolean;
-- Examining Pending Signals
function Pending_Signals
return Signal_Set;
private
<implementation-defined>
end POSIX_Signals;
POSIX_Process_Identification
with POSIX;
with <implementation-defined>;
package POSIX_Process_Indentification is
-- Process Identification
type Process_ID is private;
Null_Process_ID : constant Process_ID;
System_Process_ID : constant Process_ID;
function Get_Process_ID
return Process_ID;
function Get_Parent_Process_ID
return Process_ID;
function Image (ID : Process_ID)
return Standard.String;
function Value (Str : Standard.String )
return Process_ID ;
-- Process Group Identification
type Process_Group_ID is private;
function Get_Process_Group_ID
return Process_Group_ID;
procedure Set_Process_Group_ID
(Process : in Process_ID
:= Get_Process_ID;
Process_Group : in Process_Group_ID
:= Get_Process_Group_ID);
procedure Create_Process_Group
(Process : in Process_ID;
Process_Group : out Process_Group_ID);
procedure Create_Session (Session_Leader : out Process_Group_ID);
function Image (ID : Process_Group_ID)
return Standard.String;
function Value (Str : Standard.String )
return Process_Group_ID ;
-- User Identification
type User_ID is private;
function Get_Real_User_ID
return User_ID;
function Get_Effective_User_ID
return User_ID;
procedure Set_User_ID (ID : in User_ID);
function Get_Login_Name
return POSIX.POSIX_String;
function Image (ID : User_ID)
return Standard.String;
function Value (Str : Standard.String)
return User_ID ;
-- User Group Identification
type Group_ID is private;
function Get_Real_Group_ID
return Group_ID;
function Get_Effective_Group_ID
return Group_ID;
procedure Set_Group_ID (ID : in Group_ID);
subtype Group_List_Index is positive range 1..POSIX.Groups_Maxima'Last;
type Group_List is array (Group_List_Index range <>) of Group_ID;
function Get_Groups
return Group_List;
function Image (ID : Group_ID)
return Standard.String;
function Value (Str : Standard.String)
return Group_ID;
private
<implementation-defined>
end POSIX_Process_Indentification;
POSIX_Process_Times
with POSIX;
with <implementation-defined>;
package POSIX_Process_Times is
Ticks_Per_Second : constant := 100;
type Tick_Count is new <implementation-defined 32-bit signed integer>
-- Minimally 0 to 24 hours
function Elapsed_Real_Time
return Tick_Count;
type Process_Times is private;
function Get_Process_Times
return Process_Times;
function Elapsed_Real_Time_Of (Times : Process_Times)
return Tick_Count;
function User_CPU_Time_Of (Times : Process_Times)
return Tick_Count;
function System_CPU_Time_Of (Times : Process_Times)
return Tick_Count;
function Descendants_User_CPU_Time_Of (Times : Process_Times)
return Tick_Count;
function Descendants_System_CPU_Time_Of (Times : Process_Times)
return Tick_Count;
private
<implementation-defined>
end POSIX_Process_Times;
POSIX_Process_Environment
with POSIX;
package POSIX_Process_Environment is
-- Process Parameters
function Argument_List
return POSIX.POSIX_String_List;
-- Environment Variables
type Environment is limited private;
procedure Copy_From_Current_Environment
(Env : in out Environment);
procedure Copy_To_Current_Environment
(Env : in Environment);
procedure Copy_Environment
(Source : in Environment;
Target : in out Environment);
function Environment_Value_Of
(Name : POSIX.POSIX_String;
Env : Environment;
Undefined : POSIX.POSIX_String := "" )
return POSIX.POSIX_String;
function Environment_Value_Of
(Name : POSIX.POSIX_String;
Undefined : POSIX.POSIX_String := "" )
return POSIX.POSIX_String;
function Is_Environment_Variable
(Name : POSIX.POSIX_String;
Env : Environment)
return Boolean;
function Is_Environment_Variable
(Name : POSIX.POSIX_String)
return Boolean;
procedure Clear_Environment
(Env: in out Environment);
procedure Clear_Environment;
procedure Set_Environment_Variable
(Name : in POSIX.POSIX_String;
Value : in POSIX.POSIX_String;
Env : in out Environment);
procedure Set_Environment_Variable
(Name : in POSIX.POSIX_String;
Value : in POSIX.POSIX_String);
procedure Delete_Environment_Variable
(Name : in POSIX.POSIX_String;
Env : in out Environment);
procedure Delete_Environment_Variable
(Name : in POSIX.POSIX_String);
function Length (Env : Environment)
return Natural;
function Length
return Natural;
generic
with procedure Action
(Name : in POSIX.POSIX_String;
Value : in POSIX.POSIX_String;
Quit : in out Boolean);
procedure For_Every_Environment_Variable
(Env : in Environment);
generic
with procedure Action
(Name : in POSIX.POSIX_String;
Value : in POSIX.POSIX_String;
Quit : in out Boolean);
procedure For_Every_Current_Environment_Variable;
-- Process Working Directory
procedure Change_Working_Directory
(Directory_Name: in POSIX.Pathname);
function Get_Working_Directory
return POSIX.Pathname;
private
<implementation-defined>
end POSIX_Process_Environment;
POSIX_Calendar
with Calendar;
with <implementation-defined>;
package POSIX_Calendar is
-- Time information
type POSIX_Time is private;
function Clock
return POSIX_Time;
function To_Time (Date : POSIX_Time)
return Calendar.Time;
function To_POSIX_Time (Date : Calendar.time)
return POSIX_Time;
-- operations on POSIX_Time
subtype Year_Number is Calendar.Year_Number;
subtype Month_Number is Calendar.Month_Number;
subtype Day_Number is Calendar.Day_Number;
subtype Day_Duration is Calendar.Day_Duration;
function Year (Date: POSIX_Time)
return Year_Number;
function Month (Date: POSIX_Time)
return Month_Number;
function Day (Date: POSIX_Time)
return Day_Number;
function Seconds (Date: POSIX_Time)
return Day_Duration;
procedure Split
(Date : in POSIX_Time;
Year : out Year_Number;
Month : out Month_Number;
Day : out Day_Number;
Seconds: out Day_Duration);
function Time_Of
(Year : Year_Number;
Month : Month_Number;
Day : Day_Number;
Seconds : Day_Duration := 0.0)
return POSIX_Time;
function "+" (L: POSIX_Time; R: Duration)
return POSIX_Time;
function "+" (L: Duration; R: POSIX_Time)
return POSIX_Time;
function "-" (L: POSIX_Time; R: Duration)
return POSIX_Time;
function "-" (L: POSIX_Time; R: POSIX_Time)
return Duration;
function "<" (L, R: POSIX_Time)
return Boolean;
function "<=" (L, R: POSIX_Time)
return Boolean;
function ">" (L, R: POSIX_Time)
return Boolean;
function ">=" (L, R: POSIX_Time)
return Boolean;
Time_Error : exception
renames Calendar.Time_Error;
private
<implementation-defined>
end POSIX_Calendar;
POSIX_Configurable_System_Limits
with POSIX;
package POSIX_Configurable_System_Limits is
-- Operations to get the configurable system limits
function Argument_List_Maximum
return POSIX.Argument_List_Maxima;
function Child_Processes_Maximum
return POSIX.Child_Processes_Maxima;
function Groups_Maximum
return POSIX.Groups_Maxima;
function Open_Files_Maximum
return POSIX.Open_Files_Maxima;
function Job_Control_Supported
return POSIX.Job_Control_Support;
function Saved_IDs_Supported
return POSIX.Saved_IDs_Support;
function Stream_Maximum
return POSIX.Stream_Maxima;
function Time_Zone_String_Maximum
return POSIX.Time_Zone_String_Maxima;
type POSIX_Version is range 1970_01 .. 2099_12;
function System_POSIX_Version
return POSIX_Version;
function System_POSIX_Ada_Version
return POSIX_Version;
end POSIX_Configurable_System_Limits;
POSIX_Permissions
with POSIX;
package POSIX_Permissions is
type Permission is
(Others_Execute, Others_Write, Others_Read,
Group_Execute, Group_Write, Group_Read,
Owner_Execute, Owner_Write, Owner_Read,
Set_Group_ID, Set_User_Id);
type Permission_Set is array (Permission) of Boolean;
pragma Pack (Permission_Set);
Owner_Permission_Set : constant Permission_Set
:= Permission_Set'(
Owner_Read | Owner_Write | Owner_Execute => true,
others => false);
Group_Permission_Set : constant Permission_Set
:= Permission_Set'(
Group_Read | Group_Write | Group_Execute => true,
others => false);
Others_Permission_Set : constant Permission_Set
:= Permission_Set'(
Others_Read | Others_Write | Others_Execute => true,
Others => false);
Access_Permission_Set : constant Permission_Set
:= Permission_Set'(
Owner_Read | Owner_Write | Owner_Execute => true,
Group_Read | Group_Write | Group_Execute => true,
Others_Read | Others_Write | Others_Execute => true,
Others => false);
Set_Group_ID_Set : constant Permission_Set
:= Permission_Set'(
Set_Group_ID => true,
others => false);
Set_User_ID_Set : constant Permission_Set
:= Permission_Set'(
Set_User_ID => true,
others => false);
-- POSIX Permission-oriented operations
function Get_Allowed_Process_Permissions
return Permission_Set;
procedure Set_Allowed_Process_Permissions
(Permissions : in Permission_Set);
procedure Set_Allowed_Process_Permissions
(Permissions : in Permission_Set;
Old_Perms : out Permission_Set);
end POSIX_Permissions;
POSIX_Files
with POSIX,
POSIX_Calendar,
POSIX_Permissions,
POSIX_Process_Indentification;
with <implementation-defined>;
package POSIX_Files is
-- Operations to Create Files in the File System
procedure Create_Directory
(Pathname : in POSIX.Pathname;
Permission : in POSIX_Permissions.Permission_Set);
procedure Create_FIFO
(Pathname : in POSIX.Pathname;
Permission : in POSIX_Permissions.Permission_Set);
-- Operations to remove files from the File System
procedure Unlink (Pathname : in POSIX.Pathname);
procedure Remove_Directory (Pathname : in POSIX.Pathname);
-- Predicates on files in the File System
function Is_File (Pathname : POSIX.Pathname)
return Boolean;
function Is_Directory (Pathname : POSIX.Pathname)
return Boolean;
function Is_FIFO (Pathname : POSIX.Pathname)
return Boolean;
function Is_Character_Special_File (Pathname : POSIX.Pathname)
return Boolean;
function Is_Block_Special_File (Pathname : POSIX.Pathname)
return Boolean;
-- Operations to modify File Pathnames
procedure Link
(Old_Pathname : in POSIX.Pathname;
New_Pathname : in POSIX.Pathname);
procedure Rename
(Old_Pathname : in POSIX.Pathname;
New_Pathname : in POSIX.Pathname);
-- Iterating over files within a directory
type Directory_Entry is limited private;
function Filename_Of (D_Entry : Directory_Entry)
return POSIX.Filename;
generic
with procedure Action
(D_Entry : in Directory_Entry;
Quit : in out Boolean);
procedure For_Every_Directory_Entry
(Pathname : in POSIX.Pathname);
-- Operations to Update File Status Information
procedure Change_Owner_And_Group
(Pathname : in POSIX.Pathname;
Owner : in POSIX_Process_Indentification.User_ID;
Group : in POSIX_Process_Indentification.Group_ID);
procedure Change_Permissions
(Pathname : in POSIX.Pathname;
Permission : in POSIX_Permissions.Permission_Set);
procedure Set_File_Times
(Pathname : in POSIX.Pathname;
Access_Time : in POSIX_Calendar.Posix_Time;
Modification_Time : in POSIX_Calendar.Posix_Time);
procedure Set_File_Times (Pathname : in POSIX.Pathname);
-- Operations to Determine File Accessibility
type Access_Mode is (Read_Ok, Write_Ok, Execute_Ok);
type Access_Mode_Set is array (Access_Mode) of Boolean;
function Is_Accessible
(Pathname : POSIX.Pathname;
Access_Modes : Access_Mode_Set)
return Boolean;
function Accessibility
(Pathname : POSIX.Pathname;
Access_Modes : Access_Mode_Set)
return POSIX.Error_Code;
function Is_File_Present (Pathname : POSIX.Pathname)
return Boolean;
function Existence (Pathname : POSIX.Pathname)
return POSIX.Error_Code;
private
<implementation-defined>
end POSIX_Files;
POSIX_File_Status
with POSIX,
POSIX_Calendar,
POSIX_Permissions,
POSIX_Process_Indentification,
POSIX_IO;
with <implementation-defined>;
package POSIX_File_Status is
type Status is private;
-- Operations to Obtain File Status
function Get_File_Status (Pathname : POSIX.Pathname)
return Status;
function Get_File_Status (File : POSIX_IO.File_Descriptor)
return Status;
-- Operations to get information from Status
type File_ID is private;
type Device_ID is private;
subtype Links is natural range 0 .. POSIX.Link_Limit_Maxima'last;
function Permission_Set_Of (File_Status : Status)
return POSIX_Permissions.Permission_Set;
function File_ID_Of (File_Status : Status)
return File_ID;
function Device_ID_Of (File_Status : Status)
return Device_ID;
function Link_Count_Of (File_Status : Status)
return Links;
function Owner_Of (File_Status : Status)
return POSIX_Process_Indentification.User_ID;
function Group_Of (File_Status : Status)
return POSIX_Process_Indentification.Group_ID;
function Size_Of (File_Status : Status)
return POSIX_IO_Count;
function Last_Access_Time_Of (File_Status : Status)
return POSIX_Calendar.Posix_Time;
function Last_Modification_Time_Of (File_Status : Status)
return POSIX_Calendar.Posix_Time;
function Last_Status_Change_Time_Of (File_Status : Status)
return POSIX_Calendar.Posix_Time;
function Is_Directory (File_Status : Status)
return Boolean;
function Is_Character_Special_File (File_Status : Status)
return Boolean;
function Is_Block_Special_File (File_Status : Status)
return Boolean;
function Is_Regular_File (File_Status :Status)
return Boolean;
function Is_FIFO (File_Status :Status)
return Boolean;
private
<implementation-defined>
end POSIX_File_Status;
POSIX_Configurable_File_Limits
with POSIX,
POSIX_IO;
package POSIX_Configurable_File_Limits is
-- link limits
function Link_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Link_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Link_Limit (Pathname : POSIX.Pathname)
return POSIX.Link_Limit_Maxima;
function Link_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Link_Limit_Maxima;
-- input line limits
function Input_Line_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Input_Line_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Input_Line_Limit (Pathname : POSIX.Pathname)
return POSIX.Input_Line_Limit_Maxima;
function Input_Line_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Input_Line_Limit_Maxima;
-- input queue limits
function Input_Queue_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Input_Queue_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Input_Queue_Limit (Pathname : POSIX.Pathname)
return POSIX.Input_Queue_Limit_Maxima;
function Input_Queue_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Input_Queue_Limit_Maxima;
-- filename and pathname limits
function Filename_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Filename_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Filename_Limit (Pathname : POSIX.Pathname)
return POSIX.Filename_Limit_Maxima;
function Filename_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Filename_Limit_Maxima;
function Pathname_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Pathname_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Pathname_Limit (Pathname : POSIX.Pathname)
return POSIX.Pathname_Limit_Maxima;
function Pathname_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Pathname_Limit_Maxima;
-- pipe length limits
function Pipe_Length_Is_Limited (Pathname : POSIX.Pathname)
return Boolean;
function Pipe_Length_Is_Limited (File : POSIX_IO.File_Descriptor)
return Boolean;
function Pipe_Length_Limit (Pathname : POSIX.Pathname)
return POSIX.Pipe_Limit_Maxima;
function Pipe_Length_Limit (File : POSIX_IO.File_Descriptor)
return POSIX.Pipe_Limit_Maxima;
-- change owner restriction
function Change_Owner_Is_Restricted (Pathname : POSIX.Pathname)
return POSIX.Change_Owner_Restriction;
function Change_Owner_Is_Restricted (File : POSIX_IO.File_Descriptor)
return POSIX.Change_Owner_Restriction;
function Filename_Is_Truncated (Pathname : POSIX.Pathname)
return POSIX.Filename_Truncation;
function Filename_Is_Truncated (File : POSIX_IO.File_Descriptor)
return POSIX.Filename_Truncation;
end POSIX_Configurable_File_Limits;
POSIX_IO
with POSIX,
POSIX_Permissions;
with <implementation-defined>;
package POSIX_IO is
-- common type declarations
type File_Descriptor is range 0..POSIX.Open_Files_Maxima'Last - 1;
for File_Descriptor'Size use 32;
Standard_Input : constant File_Descriptor := 0;
Standard_Output : constant File_Descriptor := 1;
Standard_Error : constant File_Descriptor := 2;
type IO_Offset is range -2**31 .. 2**31-1;
-- File Modes and Options
type File_Mode is (Read_Only, Write_Only, Read_Write);
type Open_Option_Set is new POSIX.Option_Set;
-- Empty_Set, "+" and "-" are derived operations
Non_Blocking : constant Open_Option_Set;
Append : constant Open_Option_Set;
Truncate : constant Open_Option_Set;
Exclusive : constant Open_Option_Set;
Not_Controlling_Terminal : constant Open_Option_Set;
-- Operations to open or close file descriptors
function Open
(Name : POSIX.Pathname;
Mode : File_Mode;
Options : Open_Option_Set := Empty_Set;
Masked_Signals : POSIX.Signal_Masking := POSIX.RTS_Signals)
return File_Descriptor;
function Open_Or_Create
(Name : POSIX.Pathname;
Mode : File_Mode;
Permissions : POSIX_Permissions.Permission_Set;
Options : Open_Option_Set := Empty_Set;
Masked_Signals : POSIX.Signal_Masking := POSIX.RTS_Signals)
return File_Descriptor;
function Is_Open (File : File_Descriptor)
return Boolean;
procedure Close
(File : in File_Descriptor;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
function Duplicate
(File : File_Descriptor;
Target : File_Descriptor := 0)
return File_Descriptor;
function Duplicate_and_Close
(File : File_Descriptor;
Target : File_Descriptor := 0;
Masked_Signals : POSIX.Signal_Masking := POSIX.RTS_Signals)
return File_Descriptor;
procedure Create_Pipe
(Read_End : out File_Descriptor;
Write_End : out File_Descriptor);
-- File Input/Output operations
subtype IO_Buffer is POSIX.POSIX_String;
procedure Read
(File : in File_Descriptor;
Buffer : out IO_Buffer;
Last : out POSIX_IO_Count;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
procedure Write
(File : in File_Descriptor;
Buffer : in IO_Buffer;
Last : out POSIX_IO_Count;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
generic
type T(<>) is private;
procedure Generic_Read
(File : in File_Descriptor;
Item : out T;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
generic
type T(<>) is private;
procedure Generic_Write
(File : in File_Descriptor;
Item : in T;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
-- File position operations
type Position is
(From_Beginning, From_Current_Position, From_End_Of_File);
procedure Seek
(File : in File_Descriptor;
Offset : in IO_Offset;
Result : out IO_Offset;
Starting_Point : in Position := From_Beginning);
function File_Size (File : File_Descriptor)
return POSIX_IO_Count;
function File_Position (File : File_Descriptor)
return IO_Offset;
-- Terminal operations
function Is_A_Terminal (File : File_Descriptor)
return Boolean;
function Get_Terminal_Name (File : File_Descriptor)
return POSIX.Pathname;
-- File Control operations
procedure Get_File_Control
(File : in File_Descriptor;
Mode : out File_Mode;
Options : out Open_Option_Set);
procedure Set_File_Control
(File : in File_Descriptor;
Options : in Open_Option_Set);
function Get_Close_On_Exec (File : File_Descriptor)
return Boolean;
procedure Set_Close_On_Exec
(File : in File_Descriptor;
To : in Boolean := True);
private
<implementation-defined>
end POSIX_IO;
POSIX_File_Locking
with POSIX,
POSIX_IO,
POSIX_Process_Indentification;
with <implementation-defined>;
package POSIX_File_Locking is
type Lock_Kind is (Read_Lock, Write_Lock, Unlock);
type File_Lock (Whole_File: Boolean := True) is
record
Lock : Lock_Kind;
case Whole_File is
when True => null;
when False =>
Starting_Point : POSIX_IO.Position;
Start : POSIX_IO.IO_Offset;
Length : POSIX_IO_Count;
end case;
end record;
procedure Get_Lock
(File : in POSIX_IO.File_descriptor;
Lock : in File_Lock;
Result : out File_Lock;
Process : out POSIX_Process_Indentification.Process_ID);
procedure Set_Lock
(File : in POSIX_IO.File_Descriptor;
Lock : in File_Lock);
procedure Wait_To_Set_Lock
(File : in POSIX_IO.File_Descriptor;
Lock : in File_Lock;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
private
<implementation-defined>
end POSIX_File_Locking;
POSIX_Terminal_Functions
with POSIX,
POSIX_IO,
POSIX_Process_Indentification;
with <implementation-defined>;
package POSIX_Terminal_Functions is
-- Special Characters used in terminal input
Null_POSIX_Character : constant POSIX.POSIX_Character
:= POSIX.POSIX_Character'VAL(0);
Flag_POSIX_Character : constant POSIX.POSIX_Character
:= POSIX.POSIX_Character'VAL(255);
-- Get and Define Terminal operating characteristics
type Terminal_Characteristics is private;
Invalid_Terminal_Characteristics : constant Terminal_Characteristics;
function Get_Terminal_Characteristics
(File : POSIX_IO.File_Descriptor)
return Terminal_Characteristics;
type Terminal_Action_Times is
(Immediately, After_Output, After_Output_And_Input);
procedure Set_Terminal_Characteristics
(File : in POSIX_IO.File_Descriptor;
Characteristics : in Terminal_Characteristics;
Apply : in Terminal_Action_Times := Immediately;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
type Terminal_Modes is
-- Subtype Input_Modes:
(Interrupt_On_Break, Map_CR_To_LF, Ignore_Break,
Ignore_CR, Ignore_Parity_Errors, Map_LF_To_CR,
Enable_Parity_Check, Strip_Character, Enable_Start_Stop_Input,
Enable_Start_Stop_Output, Mark_Parity_Errors,
-- Subtype Output_Modes:
Perform_Output_Processing,
-- Subtype Control_Modes:
Ignore_Modem_Status, Enable_Receiver, Send_Two_Stop_Bits,
Hang_Up_On_Last_Close, Parity_Enable, Odd_Parity,
-- Subtype Local_Modes:
Echo, Echo_Erase, Echo_Kill, Echo_LF, Canonical_Input,
Extended_Functions, Enable_Signals, No_Flush,
Send_Signal_For_BG_Output);
subtype Input_Modes is Terminal_Modes
range Interrupt_On_Break .. Mark_Parity_Errors;
subtype Output_Modes is Terminal_Modes
range Perform_Output_Processing .. Perform_Output_Processing;
subtype Control_Modes is Terminal_Modes
range Ignore_Modem_Status .. Odd_Parity;
subtype Local_Modes is Terminal_Modes
range Echo .. Send_Signal_For_BG_Output;
type Terminal_Modes_Set is array (Terminal_Modes) of Boolean;
subtype Bits_Per_Character is Positive range 5..8;
type Baud_Rate is
(B0, B50, B75, B110, B134, B150, B200, B300, B600,
B1200, B1800, B2400, B4800, B9600, B19200, B38400);
function Terminal_Modes_Of
(Characteristics : Terminal_Characteristics)
return Terminal_Modes_Set;
procedure Define_Terminal_Modes
(Characteristics : in out Terminal_Characteristics;
Modes : in Terminal_Modes_Set);
function Bits_Per_Character_Of
(Characteristics : Terminal_Characteristics)
return Bits_Per_Character;
procedure Define_Bits_Per_Character
(Characteristics : in out Terminal_Characteristics;
Bits : in Bits_Per_Character);
function Input_Baud_Rate_Of
(Characteristics : Terminal_Characteristics)
return Baud_Rate;
procedure Define_Input_Baud_Rate
(Characteristics : in out Terminal_Characteristics;
Input_Baud_Rate : in Baud_Rate);
function Output_Baud_Rate_Of
(Characteristics : Terminal_Characteristics)
return Baud_Rate;
procedure Define_Output_Baud_Rate
(Characteristics : in out Terminal_Characteristics;
Output_Baud_Rate : in Baud_Rate);
type Control_Character_Selector is
(EOF_Char, EOL_Char, Erase_Char, Interrupt_Char,
Kill_Char, Quit_Char, Suspend_Char, Start_Char, Stop_Char);
function Special_Control_Character_Of
(Characteristics : Terminal_Characteristics;
Selector : Control_Character_Selector)
return POSIX.POSIX_Character;
procedure Define_Special_Control_Character
(Characteristics : in out Terminal_Characteristics;
Selector : in Control_Character_Selector;
Char : in POSIX.POSIX_Character);
procedure Disable_Control_Character
(Characteristics : in out Terminal_Characteristics;
Selector : in Control_Character_Selector);
function Input_Time_Of (Characteristics: Terminal_Characteristics)
return Duration;
procedure Define_Input_Time
(Characteristics : in out Terminal_Characteristics;
Input_Time : in Duration);
function Minimum_Input_Count_Of
(Characteristics : Terminal_Characteristics)
return Natural;
procedure Define_Minimum_Input_Count
(Characteristics : in out Terminal_Characteristics;
Minimum_Input_Count : in Natural);
-- Line Control Operations
procedure Send_Break
(File : in POSIX_IO.File_Descriptor;
The_Duration : in Duration := 0.0);
procedure Drain
(File : in POSIX_IO.File_Descriptor;
Masked_Signals : in POSIX.Signal_Masking
:= POSIX.RTS_Signals);
type Queue_Selector is
(Received_But_Not_Read, Written_But_Not_Transmitted, Both);
procedure Discard_Data
(File : in POSIX_IO.File_Descriptor;
Selector : in Queue_Selector);
type Flow_Action is
(Suspend_Output, Restart_Output, Transmit_Stop, Transmit_Start);
procedure Flow
(File : in POSIX_IO.File_Descriptor;
Action : in Flow_Action);
-- Foreground Process Group ID
function Get_Process_Group_ID
(File : POSIX_IO.File_Descriptor)
return POSIX_Process_Indentification.Process_Group_ID;
procedure Set_Process_Group_ID
(File : in POSIX_IO.File_Descriptor;
Group_ID : in POSIX_Process_Indentification.Process_Group_ID);
-- Get pathname of current controlling terminal for the current process
function Get_Controlling_Terminal_Name
return POSIX.Pathname;
private
<implementation-defined>
end POSIX_Terminal_Functions;
POSIX_Supplement_to_Ada_IO
with POSIX,
POSIX_IO,
POSIX_Permissions;
with <implementation-defined>;
package POSIX_Supplement_to_Ada_IO is
type File_Structure_Values is (Regular, FIFO);
type Terminal_Input_Values is (Lines, Characters);
type Possible_File_Descriptor (Valid : Boolean := False) is
record
case Valid is
when True =>
Descriptor : POSIX_IO.File_Descriptor;
when False => null;
end case;
end record;
type Form_Values_for_Open is
record
Append : Boolean := False;
Blocking : POSIX.Text_IO_Blocking_Behavior
:= POSIX_IO_Blocking_Behavior;
Terminal_Input : Terminal_Input_Values := Lines;
Page_Terminators : Boolean := True;
File_Descriptor : Possible_File_Descriptor;
end record;
type Form_Values_for_Create is
record
Permission_Mask : POSIX_Permissions.Permission_Set
:= POSIX_Permissions.Access_Permission_Set;
Blocking : POSIX.Text_IO_Blocking_Behavior
:= POSIX_IO_Blocking_Behavior;
Terminal_Input : Terminal_Input_Values := Lines;
File_Structure : File_Structure_Values := Regular;
Page_Terminators : Boolean := True;
end record;
function Form_String (Val : Form_Values_for_Open)
return String ;
function Form_Value (Str : String)
return Form_Values_for_Open;
function Form_String (Val : Form_Values_for_Create)
return String ;
function Form_Value (Str : String)
return Form_Values_for_Create;
procedure Flush_All;
procedure Flush_Text_IO (File : in Text_IO.File_Type);
generic
type File_Type is limited private;
procedure Flush_Sequential_IO (File : File_Type);
generic
type File_Type is limited private;
procedure Flush_Direct_IO (File : File_Type);
Use_Error : exception renames IO_Exceptions.Use_Error;
end POSIX_Supplement_to_Ada_IO;
POSIX_User_Database
with POSIX,
POSIX_Process_Indentification;
package POSIX_User_Database is
type User_Database_Item is private;
-- operations to get information From a User_Database_Entry
function User_Name_Of (DB_Item : User_Database_Item)
return POSIX.POSIX_String;
function User_ID_Of (DB_Item : User_Database_Item)
return POSIX_Process_Indentification.User_ID;
function Group_ID_Of (DB_Item : User_Database_Item)
return POSIX_Process_Indentification.Group_ID;
function Initial_Directory_Of (DB_Item : User_Database_Item)
return POSIX.POSIX_String;
function Initial_Program_Of (DB_Item : User_Database_Item)
return POSIX.POSIX_String;
-- operations to Get User_Database_Item
function Get_User_Database_Item
(UID : POSIX_Process_Indentification.User_ID)
return User_Database_Item;
function Get_User_Database_Item (Name : POSIX.POSIX_String)
return User_Database_Item;
end POSIX_User_Database;
POSIX_Group_Database
with POSIX,
POSIX_Process_Indentification;
package POSIX_Group_Database is
type Group_Database_Item is private;
type Group_ID_List is private;
-- operations to get information from a Group_Database_Item
function Group_Name_Of (DB_Item : Group_Database_Item)
return POSIX.POSIX_String;
function Group_ID_Of (DB_Item : Group_Database_Item)
return POSIX_Process_Indentification.Group_ID;
function Group_ID_List_Of (DB_Item : Group_Database_Item)
return Group_ID_List;
-- iterator over the Group_ID_List
generic
with procedure Action
(ID : in POSIX.POSIX_String;
Quit : in out Boolean);
procedure For_Every_Member (List: in Group_ID_List);
function Length (Member_List : Group_ID_List)
return Natural;
-- operations to get a Group_Database_Item
function Get_Group_Database_Item
(GID : POSIX_Process_Indentification.Group_ID)
return Group_Database_Item;
function Get_Group_Database_Item (Name : POSIX.POSIX_String)
return Group_Database_Item;
private
<implementation-defined>
end POSIX_Group_Database;