------------------------------------------------------------------------------ -- -- -- POSIX ADA LANGUAGE INTERFACES COMPONENTS -- -- -- -- P O S I X . S I G N A L S -- -- -- -- S p e c -- -- -- -- $Revision: 1.3 $ -- -- -- -- -- -- -- -- This package specification is part of the Florida State -- -- University (FSU) prototype implementation of IEEE Draft Std -- -- 1003.5b, for use with the Gnu NYU Ada Translator (GNAT) and the -- -- FSU Gnu Ada Runtime Library (GNARL). -- -- -- -- This package specification contains some text extracted from IEEE -- -- Draft Std 1003.5b/D5 (August 1995), IEEE Draft Standard for -- -- Information Technology -- POSIX Ada Language Interfaces -- Part 1: -- -- Binding for System Application Program Interface, Amendment 1: -- -- Realtime Extensions, copyright 1995 by the Institute of Electrical -- -- and Electronics Engineers, Inc. -- -- -- -- This package specification differs from the package specifications -- -- in IEEE Draft Std 1003.5/D5 in several respects. For example, it -- -- includes additional with-clause dependences, comments, and -- -- complete definitions for certain types, ranges, and constants that -- -- are left implementation-defined in the draft standard. These -- -- differences appear to be within the scope of variation which the -- -- draft standard permits for implementations, but no warranty is -- -- made to that effect. -- -- -- -- These package specifications are distributed in the hope that they -- -- will be useful, but WITHOUT ANY WARRANTY; without even the implied -- -- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- The package specifications in IEEE Draft Std 1003.5b/D5 represent -- -- only a portion of the document and are not to be interpreteted -- -- outside the context of the document, nor is the draft document to -- -- be interpreted as an approved consensus standard. -- -- -- -- When IEEE Std 1003.5b is approved, it must be used in conjunction -- -- with the final version of the package specifications contained in -- -- that document in order to claim conformance. The IEEE takes no -- -- responsibility for and will assume no liability for damages -- -- resulting from the reader's misinterpretation of said information -- -- resulting from its out-of-context nature. To order copies of the -- -- IEEE Draft Std 1003.5/D5, 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. -- -- -- -- For bodies to these packages, and other free products of the FSU -- -- POSIX/Ada Real-Time project, see the ftp site "ftp.cs.fsu.edu", -- -- subdirectory "pub/PART", or send e-mail to "part@ada.cs.fsu.edu". -- -- -- ------------------------------------------------------------------------------ with System; with Unchecked_Conversion; with POSIX; with Ada_Task_Identification; with Interfaces.C.System_Constants; with Interfaces.C.POSIX_RTE; with POSIX.Process_Identification; with System.Storage_Elements; with Low_Levels; with Implementation_Constants; package POSIX.Signals is package LL renames Low_Levels; package IC renames Implementation_Constants; use System; -- Signal Type type Signal is new Interfaces.C.POSIX_RTE.Signal; 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_Bus_Error, SIGBUS : 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_Abort_Ref : constant System.Address; -- Can not be used for interrupt entries. Signal_Hangup_Ref : constant System.Address; Signal_Interrupt_Ref : constant System.Address; Signal_Pipe_Write_Ref : constant System.Address; -- Currently can not be used for interrupt entries. Signal_Quit_Ref : constant System.Address; Signal_Terminate_Ref : constant System.Address; Signal_User_1_Ref : constant System.Address; -- Currently can not be used for interrupt entries. Signal_User_2_Ref : constant System.Address; Signal_Child_Ref : constant System.Address; Signal_Continue_Ref : constant System.Address; 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; -- Blocking and Unblocking Signals procedure Set_Blocked_Signals (New_Mask : in Signal_Set; Old_Mask : out Signal_Set); procedure Set_Blocked_Signals_Process (New_Mask : in Signal_Set; Old_Mask : out Signal_Set); procedure Set_Blocked_Signals_Task (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 Block_Signals_Process (Mask_to_Add : in Signal_Set; Old_Mask : out Signal_Set); procedure Block_Signals_Task (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); procedure Unblock_Signals_Process (Mask_to_Subtract : in Signal_Set; Old_Mask : out Signal_Set); procedure Unblock_Signals_Task (Mask_to_Subtract : in Signal_Set; Old_Mask : out Signal_Set); function Blocked_Signals return Signal_Set; function Blocked_Signals_Process return Signal_Set; function Blocked_Signals_Task 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; -- ??????????? FROM HERE ON, NOT IMPLEMENTED ????????????????? type Signal_Event is private; type Signal_Data is private; type Notification is range Integer'First .. Integer'Last; No_Notification : constant Notification := IC.SIGEV_NONE; Signal_Notification : constant Notification := IC.SIGEV_SIGNAL; function Get_Signal (Event : Signal_Event) return Signal; procedure Set_Signal (Event : in out Signal_Event; Sig : in Signal); function Get_Notification (Event : Signal_Event) return Notification; procedure Set_Notification (Event : in out Signal_Event; Notify : in Notification); function Get_Data (Event : Signal_Event) return Signal_Data; procedure Set_Data (Event : in out Signal_Event; Data : in Signal_Data); type Signal_Source is range Integer'First .. Integer'Last; From_Send_Signal : constant Signal_Source := IC.SI_USER; From_Queue_Signal : constant Signal_Source := IC.SI_QUEUE; From_Timer : constant Signal_Source := IC.SI_TIMER; From_Async_IO : constant Signal_Source := IC.SI_ASYNCIO; From_Message_Queue : constant Signal_Source := IC.SI_MESGQ; type Signal_Info is private; function Get_Signal (Info : Signal_Info) return Signal; procedure Set_Signal (Info : in out Signal_Info; Sig : in Signal); function Get_Source (Info : Signal_Info) return Signal_Source; procedure Set_Source (Info : in out Signal_Info; Source : in Signal_Source); function Has_Data (Source : Signal_Source) return Boolean; function Get_Data (Info : Signal_Info) return Signal_Data; procedure Set_Data (Info : in out Signal_Info; Data : in Signal_Data); -- ???????????? procedure Enable_Queueing (Sig : in Signal); -- ???????????? procedure Disable_Queueing (Sig : in Signal); -- ?????????????? function Await_Signal (Set : Signal_Set) return Signal; -- ??????????? -- function Await_Signal_Or_Timeout (Set : Signal_Set; Timeout : POSIX.Timespec) return Signal; function Await_Signal (Set : Signal_Set) return Signal_Info; function Await_Signal_Or_Timeout (Set : Signal_Set; Timeout : POSIX.Timespec) return Signal_Info; -- ?????????????? function Signal_Reference (Sig : Signal) return System.Address; -- Sending a Signal procedure Send_Signal (Process : in POSIX.Process_Identification.Process_ID; Sig : in Signal); procedure Send_Signal (Group : in POSIX.Process_Identification.Process_Group_ID; Sig : in Signal); procedure Send_Signal (Sig : in Signal); procedure Queue_Signal (Process : in POSIX.Process_Identification.Process_ID; Sig : in Signal; Data : in Signal_Data); -- ?????????????????? procedure Interrupt_Task (T : in Ada_Task_Identification.Task_ID); private type Signal_Set is new Interfaces.C.POSIX_RTE.Signal_Set; Signal_Null, SIGNULL : constant Signal := Interfaces.C.System_Constants.SIGNULL; Signal_Abort, SIGABRT : constant Signal := Interfaces.C.System_Constants.SIGABRT; Signal_Alarm, SIGALRM : constant Signal := Interfaces.C.System_Constants.SIGALRM; Signal_Bus_Error, SIGBUS : constant Signal := Implementation_Constants.SIGBUS; Signal_Floating_Point_Error, SIGFPE : constant Signal := Interfaces.C.System_Constants.SIGFPE; Signal_Hangup, SIGHUP : constant Signal := Interfaces.C.System_Constants.SIGHUP; Signal_Illegal_Instruction, SIGILL : constant Signal := Interfaces.C.System_Constants.SIGILL; Signal_Interrupt, SIGINT : constant Signal := Interfaces.C.System_Constants.SIGINT; Signal_Kill, SIGKILL : constant Signal := Interfaces.C.System_Constants.SIGKILL; Signal_Pipe_Write, SIGPIPE : constant Signal := Interfaces.C.System_Constants.SIGPIPE; Signal_Quit, SIGQUIT : constant Signal := Interfaces.C.System_Constants.SIGQUIT; Signal_Segmentation_Violation, SIGSEGV : constant Signal := Interfaces.C.System_Constants.SIGSEGV; Signal_Terminate, SIGTERM : constant Signal := Interfaces.C.System_Constants.SIGTERM; Signal_User_1, SIGUSR1 : constant Signal := Interfaces.C.System_Constants.SIGUSR1; Signal_User_2, SIGUSR2 : constant Signal := Interfaces.C.System_Constants.SIGUSR2; -- Standard Signals (job control) Signal_Child, SIGCHLD : constant Signal := Interfaces.C.System_Constants.SIGCHLD; Signal_Continue, SIGCONT : constant Signal := Interfaces.C.System_Constants.SIGCONT; Signal_Stop, SIGSTOP : constant Signal := Interfaces.C.System_Constants.SIGSTOP; Signal_Terminal_Stop, SIGTSTP : constant Signal := Interfaces.C.System_Constants.SIGTSTP; Signal_Terminal_Input, SIGTTIN : constant Signal := Interfaces.C.System_Constants.SIGTTIN; Signal_Terminal_Output, SIGTTOU : constant Signal := Interfaces.C.System_Constants.SIGTTOU; Signal_Abort_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGABRT)); Signal_Hangup_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGHUP)); Signal_Interrupt_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGINT)); Signal_Pipe_Write_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGPIPE)); Signal_Quit_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGQUIT)); Signal_Terminate_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGTERM)); Signal_User_1_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGUSR1)); Signal_User_2_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGUSR2)); Signal_Child_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGCHLD)); Signal_Continue_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGCONT)); Signal_Terminal_Stop_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGTSTP)); Signal_Terminal_Input_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGTTIN)); Signal_Terminal_Output_Ref : constant System.Address := Storage_Elements.To_Address (Storage_Elements.Integer_Address (SIGTTOU)); type Signal_Info is new LL.Siginfo; type Signal_Event is new LL.Sigevent; type Signal_Data is new LL.Sigval; end POSIX.Signals;