home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / signal.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  3.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4. SIGNAL(3)           MINTLIB LIBRARY FUNCTIONS           SIGNAL(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        signal - software signal facilities
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <signal.h>
  12.  
  13.        __Sigfunc signal(int sig, __Sigfunc func);
  14.  
  15.        __Sigfunc is defined in <signal.h> in the following way:
  16.          typedef void (*__Sigfunc) (int signum);
  17.  
  18. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  19.        Signals  are  only  handled  properly when MiNT is active.
  20.        You are advised to read the entries for  Psignal,  Psigac-
  21.        tion,  Psigpause  and  Psigblock  for  the mechanism used.
  22.        When MiNT is not active, signals are emulated  under  TOS.
  23.        This fails to handle all types of signals properly.
  24.  
  25.        Signals for MiNT are explained in the document signal.doc,
  26.        which comes with the MiNT distribution.
  27.  
  28.        A signal is generated by some abnormal event, initiated by
  29.        a user at a terminal (quit, interrupt, stop), by a program
  30.        error (bus error, etc.), by  request  of  another  program
  31.        (kill),  or when a process is stopped because it wishes to
  32.        access its control terminal while in the background.  Sig-
  33.        nals are optionally generated when a process resumes after
  34.        being stopped, when the status of child processes changes,
  35.        or  when input is ready at the control terminal. Most sig-
  36.        nals cause termination of  the  receiving  process  if  no
  37.        action  is  taken;  some signals instead cause the process
  38.        receiving them to be stopped, or are simply  discarded  if
  39.        the  process  has  not requested otherwise. Except for the
  40.        SIGKILL and SIGSTOP signals, the signal call  allows  sig-
  41.        nals  either  to be ignored or to interrupt to a specified
  42.        location.   For  a  list  of  signals  and  their  default
  43.        actions, see the file signal.doc.
  44.  
  45.        If  func  is SIG_DFL, the default action for signal sig is
  46.        reinstated. If func is SIG_IGN the signal is  subsequently
  47.        ignored and pending instances of the signal are discarded.
  48.        Otherwise, when the signal occurs further  occurrences  of
  49.        the signal are automatically blocked and func is called.
  50.  
  51.        A return from the function unblocks the handled signal and
  52.        continues the process at the point it was interrupted.
  53.  
  54.        After a fork or vfork the child inherits all signals.   An
  55.        execve  resets  all  caught signals to the default action;
  56.        ignored signals remain ignored.
  57.  
  58. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  59.        signal returns the previous action on success.   On  fail-
  60.        ure, it returns -1 and sets errno to indicate the error.
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SIGNAL(3)           MINTLIB LIBRARY FUNCTIONS           SIGNAL(3)
  71.  
  72.  
  73. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  74.        e✓ex✓xe✓ec✓cv✓ve✓e(✓(3✓3)✓),✓,  f✓fo✓or✓rk✓k(✓(3✓3)✓),✓,  g✓ge✓et✓tr✓rl✓li✓im✓mi✓it✓t(✓(3✓3)✓),✓,  k✓ki✓il✓ll✓l(✓(3✓3)✓),✓, s✓si✓ig✓gb✓bl✓lo✓oc✓ck✓k(✓(3✓3)✓),✓,
  75.        s✓si✓ig✓gs✓se✓et✓tm✓ma✓as✓sk✓k(✓(3✓3)✓),✓, v✓vf✓fo✓or✓rk✓k(✓(3✓3)✓)
  76.  
  77. N✓NO✓OT✓TE✓E
  78.        As the document signal.doc shows, signals under MiNT  work
  79.        in  a  rather  different way than the UN*X version.  Also,
  80.        the names and types of  signals  supported  are  different
  81.        from the UN*X version.
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. MiNT docs 0.1              3 March 1993                         2
  131.  
  132.  
  133.