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

  1.  
  2.  
  3.  
  4. ttttiiiimmmmeeeerrrr____ccccrrrreeeeaaaatttteeee((((3333cccc))))                                              ttttiiiimmmmeeeerrrr____ccccrrrreeeeaaaatttteeee((((3333cccc))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _tttt_iiii_mmmm_eeee_rrrr______cccc_rrrr_eeee_aaaa_tttt_eeee - create a POSIX timer
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_iiii_gggg_nnnn_aaaa_llll_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_tttt_iiii_mmmm_eeee_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _tttt_iiii_mmmm_eeee_rrrr______cccc_rrrr_eeee_aaaa_tttt_eeee_((((_cccc_llll_oooo_cccc_kkkk_iiii_dddd______tttt _c_l_o_c_k__i_d_,,,, _ssss_tttt_rrrr_uuuu_cccc_tttt _ssss_iiii_gggg_eeee_vvvv_eeee_nnnn_tttt _****_e_v_p_,,,, _tttt_iiii_mmmm_eeee_rrrr______tttt
  16.      _t_i_m_e_r_i_d_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      _tttt_iiii_mmmm_eeee_rrrr______cccc_rrrr_eeee_aaaa_tttt_eeee creates an interval timer for the calling process based on
  20.      the clock named by _c_l_o_c_k__i_d.  The new timer ID is recorded at the memory
  21.      address _t_i_m_e_r_i_d, and is unique for the calling process until the timer is
  22.      deleted.  A process may create up to {_TTTT_IIII_MMMM_EEEE_RRRR______MMMM_AAAA_XXXX} POSIX timers [see
  23.      _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C)].
  24.  
  25.      Supported clocks for _c_l_o_c_k__i_d are:
  26.  
  27.      _CCCC_LLLL_OOOO_CCCC_KKKK______RRRR_EEEE_AAAA_LLLL_TTTT_IIII_MMMM_EEEE The system's notion of the current time is obtained with
  28.                     this clock.  The time is expressed in seconds and
  29.                     nanoseconds since midnight (00:00) Coordinated Universal
  30.                     Time (UTC), January 1, 1970.  The resolution for of this
  31.                     clock is never worse than 100 HZ (which equals 10
  32.                     milliseconds).  The actual resolution of the clock depends
  33.                     on the timer capability of the underlying hardware (see
  34.                     timers(5)).
  35.  
  36.      _CCCC_LLLL_OOOO_CCCC_KKKK______SSSS_GGGG_IIII______FFFF_AAAA_SSSS_TTTT This clock has a higher resolution than _CCCC_LLLL_OOOO_CCCC_KKKK______RRRR_EEEE_AAAA_LLLL_TTTT_IIII_MMMM_EEEE and
  37.                     is available to privileged users only.  This clock is SGI
  38.                     specific and is not portable.
  39.  
  40.      The resolution of the clocks can be obtained by calling the _cccc_llll_oooo_cccc_kkkk______gggg_eeee_tttt_rrrr_eeee_ssss
  41.      function.
  42.  
  43.      The timer created can be started by calling the function _tttt_iiii_mmmm_eeee_rrrr______ssss_eeee_tttt_tttt_iiii_mmmm_eeee.
  44.      If the value of _e_v_p is non-NULL, then a notification specified in the _e_v_p
  45.      sigevent structure is sent to the process.
  46.  
  47.      If the _ssss_iiii_gggg_eeee_vvvv______nnnn_oooo_tttt_iiii_ffff_yyyy member of _e_v_p is SIGEV_SIGNAL then the specified
  48.      signal in the _ssss_iiii_gggg_eeee_vvvv______ssss_iiii_gggg_nnnn_oooo member of _e_v_p is sent to the process and if the
  49.      value is SIGEV_NONE no signal is sent upon timer expiration.
  50.  
  51.      If the _ssss_iiii_gggg_eeee_vvvv______nnnn_oooo_tttt_iiii_ffff_yyyy member of _e_v_p is SIGEV_THREAD then the function
  52.      _ssss_iiii_gggg_eeee_vvvv______nnnn_oooo_tttt_iiii_ffff_yyyy______ffff_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn will be called by a new thread (see pthreads(5))
  53.      with _ssss_iiii_gggg_eeee_vvvv______vvvv_aaaa_llll_uuuu_eeee as the argument.  This thread is created when the event
  54.      arrives with the attributes specified in _ssss_iiii_gggg_eeee_vvvv______nnnn_oooo_tttt_iiii_ffff_yyyy______aaaa_tttt_tttt_rrrr_iiii_bbbb_uuuu_tttt_eeee_ssss except
  55.      that it is automatically detached.  The calling process should ensure
  56.      there are sufficient resources to create the thread.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ttttiiiimmmmeeeerrrr____ccccrrrreeeeaaaatttteeee((((3333cccc))))                                              ttttiiiimmmmeeeerrrr____ccccrrrreeeeaaaatttteeee((((3333cccc))))
  71.  
  72.  
  73.  
  74.      If the _e_v_p argument is NULL, then the signal SIGALRM is sent to the
  75.      process, upon timer expiration.
  76.  
  77.      The timers are not inherited across the _ffff_oooo_rrrr_kkkk, _ssss_pppp_rrrr_oooo_cccc, or _eeee_xxxx_eeee_cccc system
  78.      calls.
  79.  
  80.      _tttt_iiii_mmmm_eeee_rrrr______cccc_rrrr_eeee_aaaa_tttt_eeee will fail if one or more of the following are true:
  81.  
  82.      [EAGAIN]       The calling process has reached its per-process timer
  83.                     creation limit of {_TTTT_IIII_MMMM_EEEE_RRRR______MMMM_AAAA_XXXX}.
  84.  
  85.      [EAGAIN]       The system lacks sufficient resources for queuing
  86.                     additional signals.
  87.  
  88.      [EINVAL]       The specified clock ID is invalid. Or the signal specified
  89.                     in the _e_v_p structure is invalid.
  90.  
  91.      [EPERM]        The process is not privileged to create a timer of the
  92.                     specified clock type.
  93.  
  94.      [EFAULT]       The address specified by either _t_i_m_e_r_i_d or _e_v_p is outside
  95.                     the range of the address space of the calling process.
  96.  
  97. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  98.      _tttt_iiii_mmmm_eeee_rrrr______dddd_eeee_llll_eeee_tttt_eeee(3C), _tttt_iiii_mmmm_eeee_rrrr______ssss_eeee_tttt_tttt_iiii_mmmm_eeee(3C), _tttt_iiii_mmmm_eeee_rrrr______gggg_eeee_tttt_tttt_iiii_mmmm_eeee(3C),
  99.      _tttt_iiii_mmmm_eeee_rrrr______gggg_eeee_tttt_oooo_vvvv_eeee_rrrr_rrrr_uuuu_nnnn(3C), _cccc_llll_oooo_cccc_kkkk______gggg_eeee_tttt_rrrr_eeee_ssss(2), _ssss_iiii_gggg_aaaa_cccc_tttt_iiii_oooo_nnnn(2), _ssss_yyyy_ssss_cccc_oooo_nnnn_ffff(3C),
  100.      _pppp_tttt_hhhh_rrrr_eeee_aaaa_dddd_ssss(5)
  101.  
  102. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  103.      Upon successful completion, a value of 0 is returned and the timer ID of
  104.      the created timer is set in the location pointed to by the _t_i_m_e_r_i_d
  105.      argument.  Otherwise, a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to
  106.      indicate the error.
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.