home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / EFFO / forum7.lzh / RICO / MAN / man.signal < prev    next >
Text File  |  1988-09-26  |  3KB  |  167 lines

  1.  
  2.  
  3. signal()          os9-68000 Programmers Manual           signal()
  4.  
  5.  
  6.  
  7. NAME       
  8.  
  9.      signal - simplified software signal facilities 
  10.  
  11. SYNOPSIS       
  12.  
  13.      #include <signal.h> 
  14.  
  15.      typedef int (* handler_func)();
  16.  
  17.      handler_func signal(sig,func);
  18.  
  19.      int sig; 
  20.  
  21.      handlerfunc func; 
  22.  
  23. DESCRIPTION       
  24.  
  25.      A  signal  is  generated  by  some  abnormal  event,  by  an
  26.      external   signal  (keyboard  interrupt)  or  program  error
  27.      (overflow   ...).   All  signal  cause  termination  of  the
  28.      receiving  process  if  no  action  is  taken.   Except  for
  29.      SIGKILL,  the  signal  facility  allows signals either to be
  30.      ignored  or to cause an interrupt to some specific location.
  31.      The  following  is  a  list of all signals as in the include
  32.      file <signal.h>: 
  33.  
  34.      OS9 signals 
  35.  
  36.      SIGKILL         0 System  abort  (cannot  be  caught  or
  37.                                        ignored)
  38.  
  39.      SIGWAKE         1 Wake up 
  40.  
  41.      SIGQUIT         2 Keyboard abort 
  42.  
  43.      SIGINT          3 Keyboard interrupt 
  44.  
  45.      OS-9 error traps 
  46.  
  47.      SIGBUSERR       -1 Bus error 
  48.  
  49.      SIGBUS          -1 Bus error 
  50.  
  51.      SIGADDERR       -2 Address error 
  52.  
  53.      SIGILLINS       -3 Illegal instruction 
  54.  
  55.      SIGILL          -3 Illegal instruction 
  56.  
  57.      SIGZERODIV      -4 Integer zero division 
  58.  
  59.      SIGCHK          -5 Range error 
  60.  
  61.      SIGTRAPV        -6 Overflow 
  62.  
  63.      SIGFPE          -6 Floating point error 
  64.  
  65.      SIGPRIV         -7 Privilege violation 
  66.  
  67.      SIG1010         -8 1010 opcode emulator 
  68.  
  69.      SIG1111         -9 1111 opcode emulator 
  70.  
  71.      Special addresses 
  72.  
  73.      SIGDFL          0 Default behaviour (exit with error) 
  74.  
  75.      SIGIGN          1 Ignore signal 
  76.  
  77.      If  func  is  SIGDFL,  the  default action for signal sig is
  78.      taken  (exit  with  error). If func is SIGIGN, the signal is
  79.      ignored.    Otherwise,   when   the  signal  occurs  further
  80.      occurrences  of  the  signal  are  automatically blocked and
  81.      func  is  called.   A  return from the function unblocks the
  82.      handled  signal  and  continues  the process at the point it
  83.      was  interrupted.  The signal handler func remains installed
  84.      after  a  signal has been delivered. Func is called with the
  85.      signal  number  as  int argument. The value of signal is the
  86.      previous  (or  initial)  value of func for that signal or -1
  87.      in case of an error.  
  88.  
  89. RETURN VALUE      
  90.  
  91.      The  previous  action  is  returned  on  a  successful call,
  92.      otherwise -1 is returned to indicate an error.  
  93.  
  94. LIBRARY       
  95.  
  96.      use signal.l 
  97.  
  98. SEE ALSO      
  99.  
  100.      intercept()  (OS9  Microware  C  library),  F$Icpt (OS9 Technical
  101.      manual) 
  102.  
  103. AUTHOR       
  104.  
  105.      Rico Cozzio 
  106.  
  107. PROBLEMS       
  108.  
  109.      SIGBUS,SIGBUSERR,SIGADDERR  may interrupt the process at any
  110.      point  of  opcode  execution. So the process interrupted may
  111.      not  reasonably  continue.   It is recommended not to return
  112.      to  the interrupted process, but to abort the program at the
  113.      end of the interrupt routine.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. signal()                                                   page 3
  166.  
  167.