Parent: [c017f0] (diff)

Child: [8d1c2d] (diff)

Download this file

Signals.def.m2cc    74 lines (61 with data), 3.8 kB

#ifdef __XDS__
<*+ M2ADDTYPES *>
<*+ M2EXTENSIONS *>
<*+ NOHEADER *>
<* IF NOT DEFINED(GENCTYPES) THEN *> <* NEW GENTYPEDEF+ *> <* END *>
<*+ CSTDLIB *>
  
DEFINITION MODULE ["C"]   Signals; (* XDS *)

#endif
#ifdef __GM2__
DEFINITION MODULE FOR "C" Signals; (* GNU M2 *)

#endif
#ifdef __MOCKA__
FOREIGN MODULE Signals; (* Mocka  *)
#endif

  (*========================================================================*)
  (* WICHTIG: BITTE NUR DIE DATEI Signals.def.m2cc EDITIEREN !!!            *)
  (*========================================================================*)
  (* Es sind 3 Versionen enthalten die mit                                  *)
  (*                                                                        *)
  (*   m2cc -D __{Parameter}__ < Signals.def.m2cc > Signals.def             *)
  (*                                                                        *)
  (* mit Parameter = {XDS|GM2} erzeugt werden koennen.                      *)
  (*                                                                        *)
  (*   XDS   : Parameter werden fuer den XDS Modula-2 Compilter gesetzt     *)
  (*   GM2   : Parameter werden fuer den GNU Modula-2 Compilter gesetzt     *)
  (*   MOCKA : Parameter werden fuer den MOCKA        Compilter gesetzt     *)
  (*                                                                        *)
  (* Interface to UNIX signals, there versions are contained for XDS, GNU   *)
  (* and the Mocka complier, can be obtained by the commad line shown       *)
  (*------------------------------------------------------------------------*)
  (* Implementation : Michael Riedl                                         *)
  (* Licence        : GNU Lesser General Public License (LGPL)              *)
  (*------------------------------------------------------------------------*)

  (* $Id: Signals.def.m2cc,v 1.4 2018/01/14 15:30:34 mriedl Exp $ *)

CONST (* Signal    Value    Action             Comment                        *)

        SIGHUP   =   1; (*   A     Hangup detected on controlling terminal    *)
        SIGINT   =   2; (*   A     Interrupt from keyboard                    *)
        SIGQUIT  =   3; (*   A     Quit from keyboard                         *)
        SIGILL   =   4; (*   A     Illegal Instruction                        *)
        SIGTRAP  =   5; (*   CG    Trace/breakpoint trap                      *)
        SIGABRT  =   6; (*   C     Abort signal from abort(3)                 *)
        SIGFPE   =   8; (*   C     Floating point exception                   *)
        SIGKILL  =   9; (*  AEF    Kill signal                                *)
        SIGSEGV  =  11; (*   C     Invalid memory reference                   *)
        SIGPIPE  =  13; (*   A     Broken pipe: write to pipe with no readers *)
        SIGALRM  =  14; (*   A     Timer signal from alarm(1)                 *)
        SIGTERM  =  15; (*   A     Termination signal                         *)

        (* The  letters  in  the  "Action"  column have the following *)
        (* meanings :                                                 *)
        (*                                                            *)
        (*   A  :   Default action is to terminate the process.       *)
        (*   B  :   Default action is to ignore the signal.           *)
        (*   C  :   Default action is to dump core.                   *)
        (*   D  :   Default action is to stop the process.            *)
        (*   E  :   Signal cannot be caught.                          *)
        (*   F  :   Signal cannot be ignored.                         *)
        (*   G  :   Not a POSIX.1 conformant signal.                  *)


TYPE   SigHandler = PROCEDURE(INTEGER);

PROCEDURE signal(signum  : INTEGER;
                 handler : SigHandler);

END Signals.