home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / getitimer.z / getitimer
Encoding:
Text File  |  2001-04-17  |  7.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. GGGGEEEETTTTIIIITTTTIIIIMMMMEEEERRRR((((2222))))                                                      GGGGEEEETTTTIIIITTTTIIIIMMMMEEEERRRR((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      getitimer, setitimer - get/set value of interval timer
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttiiiimmmmeeee....hhhh>>>>
  13.  
  14.      ####ddddeeeeffffiiiinnnneeee IIIITTTTIIIIMMMMEEEERRRR____RRRREEEEAAAALLLL      0000    ////**** rrrreeeeaaaallll ttttiiiimmmmeeee iiiinnnntttteeeerrrrvvvvaaaallllssss ****////
  15.      ####ddddeeeeffffiiiinnnneeee IIIITTTTIIIIMMMMEEEERRRR____VVVVIIIIRRRRTTTTUUUUAAAALLLL   1111    ////**** vvvviiiirrrrttttuuuuaaaallll ttttiiiimmmmeeee iiiinnnntttteeeerrrrvvvvaaaallllssss ****////
  16.      ####ddddeeeeffffiiiinnnneeee IIIITTTTIIIIMMMMEEEERRRR____PPPPRRRROOOOFFFF      2222    ////**** uuuusssseeeerrrr aaaannnndddd ssssyyyysssstttteeeemmmm vvvviiiirrrrttttuuuuaaaallll ttttiiiimmmmeeee ****////
  17.  
  18.      iiiinnnntttt ggggeeeettttiiiittttiiiimmmmeeeerrrr((((iiiinnnntttt wwwwhhhhiiiicccchhhh,,,, ssssttttrrrruuuucccctttt iiiittttiiiimmmmeeeerrrrvvvvaaaallll ****vvvvaaaalllluuuueeee))));;;;
  19.  
  20.      iiiinnnntttt sssseeeettttiiiittttiiiimmmmeeeerrrr((((iiiinnnntttt wwwwhhhhiiiicccchhhh,,,, ssssttttrrrruuuucccctttt iiiittttiiiimmmmeeeerrrrvvvvaaaallll ****vvvvaaaalllluuuueeee,,,,
  21.                ssssttttrrrruuuucccctttt iiiittttiiiimmmmeeeerrrrvvvvaaaallll ****oooovvvvaaaalllluuuueeee))));;;;
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      The system provides each process with three interval timers, defined in
  25.      <ssssyyyyssss////ttttiiiimmmmeeee....hhhh>.  The _g_e_t_i_t_i_m_e_r call returns the current value for the timer
  26.      specified in _w_h_i_c_h, while the _s_e_t_i_t_i_m_e_r call sets the value of a timer
  27.      (optionally returning the previous value of the timer).
  28.  
  29.      A timer value is defined by the _i_t_i_m_e_r_v_a_l structure:
  30.  
  31.           struct itimerval {
  32.                struct    timeval it_interval;     /* timer interval */
  33.                struct    timeval it_value;        /* current value */
  34.           };
  35.  
  36.      If _i_t__v_a_l_u_e is non-zero, it indicates the time to the next timer
  37.      expiration and not the time the timer was set originally.  If _i_t__i_n_t_e_r_v_a_l
  38.      is non-zero, it specifies a value to be used in reloading _i_t__v_a_l_u_e when
  39.      the timer expires.  Setting _i_t__v_a_l_u_e to 0 disables a timer.  Setting
  40.      _i_t__i_n_t_e_r_v_a_l to 0 causes a timer to be disabled after its next expiration
  41.      (assuming _i_t__v_a_l_u_e is non-zero).
  42.  
  43.      For IIIITTTTIIIIMMMMEEEERRRR____VVVVIIIIRRRRTTTTUUUUAAAALLLL and IIIITTTTIIIIMMMMEEEERRRR____PPPPRRRROOOOFFFF, the timer resolution is 100 HZ (which
  44.      equals 10 milliseconds). Time values that are not a multiple of 100 HZ
  45.      will be rounded to a multiple.
  46.  
  47.      For IIIITTTTIIIIMMMMEEEERRRR____RRRREEEEAAAALLLL, the timer resolution is 100 HZ (which equals 10
  48.      milliseconds) for normal processes. For processes with a real time
  49.      scheduling policy (see _s_c_h_e_d _s_e_t_s_c_h_e_d_u_l_e_r (2)), actual resolution of the
  50.      clock depends on the timer capability of the underlying hardware (see
  51.      _t_i_m_e_r_s (5)).  To avoid a reduction in overall system performance, normal
  52.      processes are not permitted to use the high resolution timers, since fast
  53.      itimer requests can add considerable system overhead.
  54.  
  55.      The IIIITTTTIIIIMMMMEEEERRRR____RRRREEEEAAAALLLL timer decrements in real time.  A SSSSIIIIGGGGAAAALLLLRRRRMMMM signal is
  56.      delivered when this timer expires.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. GGGGEEEETTTTIIIITTTTIIIIMMMMEEEERRRR((((2222))))                                                      GGGGEEEETTTTIIIITTTTIIIIMMMMEEEERRRR((((2222))))
  71.  
  72.  
  73.  
  74.      The IIIITTTTIIIIMMMMEEEERRRR____VVVVIIIIRRRRTTTTUUUUAAAALLLL timer decrements in process virtual time.  It runs
  75.      only when the process is executing.  A SSSSIIIIGGGGVVVVTTTTAAAALLLLRRRRMMMM signal is delivered when
  76.      it expires.
  77.  
  78.      The IIIITTTTIIIIMMMMEEEERRRR____PPPPRRRROOOOFFFF timer decrements both in process virtual time and when
  79.      the system is running on behalf of the process.  It is designed to be
  80.      used by interpreters in statistically profiling the execution of
  81.      interpreted programs.  Each time the IIIITTTTIIIIMMMMEEEERRRR____PPPPRRRROOOOFFFF timer expires, the
  82.      SSSSIIIIGGGGPPPPRRRROOOOFFFF signal is delivered.  Because this signal may interrupt in-
  83.      progress system calls, programs using this timer must be prepared to
  84.      restart interrupted system calls.
  85.  
  86. NNNNOOOOTTTTEEEESSSS
  87.      Three macros for manipulating time values are defined in <ssssyyyyssss////ttttiiiimmmmeeee....hhhh>.
  88.      _t_i_m_e_r_c_l_e_a_r sets a time value to zero, _t_i_m_e_r_i_s_s_e_t tests if a time value is
  89.      non-zero, and _t_i_m_e_r_c_m_p compares two time values (beware that >= and <= do
  90.      not work with this macro).
  91.  
  92. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  93.      ftimer(1), lboot(1M), npri(1), systune(1M), schedctl(2), sigset(2),
  94.      timers(5).
  95.  
  96. FFFFIIIILLLLEEEESSSS
  97.      /var/sysgen/mtune/kernel fast itimer configuration variables.
  98.  
  99. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  100.      If the calls succeed, a value of 0 is returned.  If an error occurs, the
  101.      value -1 is returned, and _e_r_r_n_o will be set.  _s_e_t_i_t_i_m_e_r and _g_e_t_i_t_i_m_e_r
  102.      will fail if any of the following are true:
  103.  
  104.      [EFAULT]       The _v_a_l_u_e or _o_v_a_l_u_e structure specified a bad address.
  105.  
  106.      [EINVAL]       A _v_a_l_u_e structure specified a time was too large to be
  107.                     handled.
  108.  
  109. BBBBUUUUGGGGSSSS
  110.      _s_e_t_i_t_i_m_e_r calls reset the alarm clock (see _a_l_a_r_m(2)) of the calling
  111.      process.
  112.  
  113.      Programs cannot use _g_e_t_i_t_i_m_e_r(_2) to accurately determine how much time
  114.      remains until the timer expires.  On the Challenge/Onyx hardware family,
  115.      _i_t__v_a_l_u_e is not updated at a constant rate.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.