home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / man / cat2 / gettimeofday.0 < prev    next >
Text File  |  1993-12-07  |  3KB  |  67 lines

  1.  
  2. GETTIMEOFDAY(2)            UNIX Programmer's Manual            GETTIMEOFDAY(2)
  3.  
  4. NNAAMMEE
  5.      ggeettttiimmeeooffddaayy, sseettttiimmeeooffddaayy - get/set date and time
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttiimmee..hh>>
  9.  
  10.      _i_n_t
  11.      ggeettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p)
  12.  
  13.      _i_n_t
  14.      sseettttiimmeeooffddaayy(_s_t_r_u_c_t _t_i_m_e_v_a_l _*_t_p, _s_t_r_u_c_t _t_i_m_e_z_o_n_e _*_t_z_p)
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      NNoottee:: ttiimmeezzoonnee iiss nnoo lloonnggeerr uusseedd;; tthhiiss iinnffoorrmmaattiioonn iiss kkeepptt oouuttssiiddee tthhee
  18.      kkeerrnneell..   The system's notion of the current Greenwich time and the cur­
  19.      rent time zone is obtained with the ggeettttiimmeeooffddaayy() call, and set with the
  20.      sseettttiimmeeooffddaayy() call.  The time is expressed in seconds and microseconds
  21.      since midnight (0 hour), January 1, 1970.  The resolution of the system
  22.      clock is hardware dependent, and the time may be updated continuously or
  23.      in ``ticks.''  If _t_p or _t_z_p is NULL, the associated time information will
  24.      not be returned or set.
  25.  
  26.      The structures pointed to by _t_p and _t_z_p are defined in <_s_y_s_/_t_i_m_e_._h> as:
  27.  
  28.      struct timeval {
  29.              long    tv_sec;         /* seconds since Jan. 1, 1970 */
  30.              long    tv_usec;        /* and microseconds */
  31.      };
  32.  
  33.      struct timezone {
  34.              int     tz_minuteswest; /* of Greenwich */
  35.              int     tz_dsttime;     /* type of dst correction to apply */
  36.      };
  37.  
  38.      The _t_i_m_e_z_o_n_e structure indicates the local time zone (measured in minutes
  39.      of time westward from Greenwich), and a flag that, if nonzero, indicates
  40.      that Daylight Saving time applies locally during the appropriate part of
  41.      the year.
  42.  
  43.      Only the super­user may set the time of day or time zone.
  44.  
  45. RREETTUURRNN
  46.      A 0 return value indicates that the call succeeded.  A ­1 return value
  47.      indicates an error occurred, and in this case an error code is stored in­
  48.      to the global variable _e_r_r_n_o.
  49.  
  50. EERRRROORRSS
  51.      The following error codes may be set in _e_r_r_n_o:
  52.  
  53.      [EFAULT]  An argument address referenced invalid memory.
  54.  
  55.      [EPERM]   A user other than the super­user attempted to set the time.
  56.  
  57. SSEEEE AALLSSOO
  58.      date(1),  adjtime(2),  ctime(3),  timed(8)
  59.  
  60. HHIISSTTOORRYY
  61.      The ggeettttiimmeeooffddaayy function call appeared in 4.2BSD.
  62.  
  63. 4th Berkeley Distribution       March 10, 1991                               1
  64.  
  65.  
  66.  
  67.