home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat2 / standard / sigaltstack.z / sigaltstack
Encoding:
Text File  |  2002-10-03  |  9.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ssssiiiiggggaaaallllttttssssttttaaaacccckkkk((((2222))))                                                  ssssiiiiggggaaaallllttttssssttttaaaacccckkkk((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk - set or get signal alternate stack context
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_iiii_gggg_nnnn_aaaa_llll_...._hhhh_>>>>
  13.  
  14.      _iiii_nnnn_tttt _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk_((((_cccc_oooo_nnnn_ssss_tttt _ssss_tttt_aaaa_cccc_kkkk______tttt _****_ssss_ssss_,,,, _ssss_tttt_aaaa_cccc_kkkk______tttt _****_oooo_ssss_ssss_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk allows users to define an alternate stack area on which
  18.      signals are to be processed.  If _s_s is non-zero, it specifies a pointer
  19.      to, and the size of a stack area on which to deliver signals, and tells
  20.      the system if the process is currently executing on that stack. When a
  21.      signal's action indicates its handler should execute on the alternate
  22.      signal stack [specified with a _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2) call], the system checks to
  23.      see if the process is currently executing on that stack.  If the process
  24.      is not currently executing on the signal stack, the system arranges a
  25.      switch to the alternate signal stack for the duration of the signal
  26.      handler's execution.
  27.  
  28.      The structure _ssss_tttt_aaaa_cccc_kkkk______tttt includes the following members.
  29.  
  30.           _cccc_hhhh_aaaa_rrrr _****_ssss_ssss______ssss_pppp
  31.           _iiii_nnnn_tttt   _ssss_ssss______ssss_iiii_zzzz_eeee
  32.           _iiii_nnnn_tttt   _ssss_ssss______ffff_llll_aaaa_gggg_ssss
  33.  
  34.      If _s_s is not _NNNN_UUUU_LLLL_LLLL, it points to a structure specifying the alternate
  35.      signal stack that will take effect upon return from _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk.  The
  36.      _ssss_ssss______ssss_pppp and _ssss_ssss______ssss_iiii_zzzz_eeee fields specify the new base and size of the stack.  The
  37.      _ssss_ssss______ssss_pppp field should be adjusted for the direction of growth (see example
  38.      below).  The _ssss_ssss______ffff_llll_aaaa_gggg_ssss field specifies the new stack state and may be set
  39.      to the following:
  40.  
  41.      _SSSS_SSSS______DDDD_IIII_SSSS_AAAA_BBBB_LLLL_EEEE    The stack is to be disabled and _ssss_ssss______ssss_pppp and _ssss_ssss______ssss_iiii_zzzz_eeee are
  42.                    ignored.  If _SSSS_SSSS______DDDD_IIII_SSSS_AAAA_BBBB_LLLL_EEEE is not set, the stack will be
  43.                    enabled.
  44.  
  45.      If _o_s_s is not _NNNN_UUUU_LLLL_LLLL, it points to a structure specifying the alternate
  46.      signal stack that was in effect prior to the call to _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk.  The
  47.      _ssss_ssss______ssss_pppp and _ssss_ssss______ssss_iiii_zzzz_eeee fields specify the base and size of that stack.  The
  48.      _ssss_ssss______ffff_llll_aaaa_gggg_ssss field specifies the stack's state, and may contain the following
  49.      values:
  50.  
  51.      _SSSS_SSSS______OOOO_NNNN_SSSS_TTTT_AAAA_CCCC_KKKK    The process is currently executing on the alternate signal
  52.                    stack.  Attempts to modify the alternate signal stack while
  53.                    the process is executing on it will fail.  _SSSS_SSSS______OOOO_NNNN_SSSS_TTTT_AAAA_CCCC_KKKK
  54.                    cannot be modified by users.
  55.  
  56.      _SSSS_SSSS______DDDD_IIII_SSSS_AAAA_BBBB_LLLL_EEEE    The alternate signal stack is currently disabled.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ssssiiiiggggaaaallllttttssssttttaaaacccckkkk((((2222))))                                                  ssssiiiiggggaaaallllttttssssttttaaaacccckkkk((((2222))))
  71.  
  72.  
  73.  
  74.      _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk fails if any of the following is true:
  75.  
  76.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT        Either _s_s or _o_s_s points outside the process's allocated
  77.                    address space.
  78.  
  79.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL        If _s_s is non-null, and the _ssss_ssss______ffff_llll_aaaa_gggg_ssss field pointed to by _s_s
  80.                    contains invalid flags.
  81.  
  82.      _EEEE_PPPP_EEEE_RRRR_MMMM         If an attempt was made to modify an active stack.
  83.  
  84.      _EEEE_NNNN_OOOO_MMMM_EEEE_MMMM        The size of the alternate stack area is less than
  85.                    _MMMM_IIII_NNNN_SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ.
  86.  
  87. NNNNOOOOTTTTEEEESSSS
  88.      The value _SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ is defined to be the number of bytes that would be
  89.      used to cover the usual case when allocating an alternate stack area.
  90.      The value _MMMM_IIII_NNNN_SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ is defined to be the minimum stack size for a
  91.      signal handler.  In computing an alternate stack size, a program should
  92.      add that amount to its stack requirements to allow for the operating
  93.      system overhead.
  94.  
  95.      The stack grows downward from high to lower addresses.  The following
  96.      code fragment is typically used to allocate an alternate stack.
  97.  
  98.           _iiii_ffff _((((_((((_ssss_iiii_gggg_ssss_tttt_kkkk_...._ssss_ssss______ssss_pppp _==== _((((_cccc_hhhh_aaaa_rrrr _****_))))_mmmm_aaaa_llll_llll_oooo_cccc_((((_SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ_))))_)))) _====_==== _NNNN_UUUU_LLLL_LLLL_))))
  99.                _////_**** _eeee_rrrr_rrrr_oooo_rrrr _rrrr_eeee_tttt_uuuu_rrrr_nnnn _****_////_;;;;
  100.  
  101.           _ssss_iiii_gggg_ssss_tttt_kkkk_...._ssss_ssss______ssss_pppp _++++_==== _SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ _---- _1111_;;;;
  102.                _////_**** _aaaa_dddd_jjjj_uuuu_ssss_tttt _ssss_ssss______ssss_pppp _tttt_oooo _pppp_oooo_iiii_nnnn_tttt _tttt_oooo _bbbb_aaaa_ssss_eeee _oooo_ffff _ssss_tttt_aaaa_cccc_kkkk _****_////
  103.           _ssss_iiii_gggg_ssss_tttt_kkkk_...._ssss_ssss______ssss_iiii_zzzz_eeee _==== _SSSS_IIII_GGGG_SSSS_TTTT_KKKK_SSSS_ZZZZ_;;;;
  104.           _ssss_iiii_gggg_ssss_tttt_kkkk_...._ssss_ssss______ffff_llll_aaaa_gggg_ssss _==== _0000_;;;;
  105.           _iiii_ffff _((((_ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk_((((_&&&&_ssss_iiii_gggg_ssss_tttt_kkkk_,,,, _((((_ssss_tttt_aaaa_cccc_kkkk______tttt _****_))))_0000_)))) _<<<< _0000_))))
  106.                _pppp_eeee_rrrr_rrrr_oooo_rrrr_((((_""""_ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk_""""_))))_;;;;
  107.  
  108. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  109.      _gggg_eeee_tttt_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(2), _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2), _ssss_iiii_gggg_ssss_eeee_tttt_jjjj_mmmm_pppp(3C), _uuuu_cccc_oooo_nnnn_tttt_eeee_xxxx_tttt(5).
  110.  
  111. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  112.      On success, _ssss_iiii_gggg_aaaa_llll_tttt_ssss_tttt_aaaa_cccc_kkkk returns zero.  On failure, it returns -1 and sets
  113.      _eeee_rrrr_rrrr_nnnn_oooo to indicate the error.
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.