]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/man/man2/gettimeofday.2
xnu-6153.121.1.tar.gz
[apple/xnu.git] / bsd / man / man2 / gettimeofday.2
index 67f2760c63ce804defdc9f7190994d4880e3b86a..179e9bc0cb44e5d620552fee9cc3ae529f0c7360 100644 (file)
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)gettimeofday.2     8.2 (Berkeley) 5/26/95
 .\"
 .\"
 .\"     @(#)gettimeofday.2     8.2 (Berkeley) 5/26/95
 .\"
-.Dd May 26, 1995
+.Dd August 5, 2008
 .Dt GETTIMEOFDAY 2
 .Os BSD 4
 .Sh NAME
 .Dt GETTIMEOFDAY 2
 .Os BSD 4
 .Sh NAME
 .Fa "const struct timezone *tzp"
 .Fc
 .Sh DESCRIPTION
 .Fa "const struct timezone *tzp"
 .Fc
 .Sh DESCRIPTION
-.Bf -symbolic
-Note: timezone is no longer used; this information is kept outside
-the kernel.
-.Ef
 .Pp
 The system's notion of the current Greenwich time and the current time
 zone is obtained with the
 .Pp
 The system's notion of the current Greenwich time and the current time
 zone is obtained with the
@@ -68,10 +64,24 @@ since midnight (0 hour), January 1, 1970.  The resolution of the system
 clock is hardware dependent, and the time may be updated continuously or
 in ``ticks.''  If
 .Fa tp
 clock is hardware dependent, and the time may be updated continuously or
 in ``ticks.''  If
 .Fa tp
-or
+is NULL
+and
 .Fa tzp
 .Fa tzp
-is NULL, the associated time
-information will not be returned or set.
+is non-NULL,
+.Fn gettimeofday
+will populate the timezone struct in 
+.Fa tzp .
+If 
+.Fa tp
+is non-NULL and
+.Fa tzp 
+is NULL, then only the timeval struct in
+.Fa tp
+is populated. If both
+.Fa tp
+and
+.Fa tzp
+are NULL, nothing is returned.
 .Pp
 The structures pointed to by
 .Fa tp
 .Pp
 The structures pointed to by
 .Fa tp
@@ -82,6 +92,7 @@ are defined in
 as:
 .Pp
 .Bd -literal
 as:
 .Pp
 .Bd -literal
+
 struct timeval {
        time_t       tv_sec;   /* seconds since Jan. 1, 1970 */
        suseconds_t  tv_usec;  /* and microseconds */
 struct timeval {
        time_t       tv_sec;   /* seconds since Jan. 1, 1970 */
        suseconds_t  tv_usec;  /* and microseconds */
@@ -91,6 +102,7 @@ struct timezone {
        int     tz_minuteswest; /* of Greenwich */
        int     tz_dsttime;     /* type of dst correction to apply */
 };
        int     tz_minuteswest; /* of Greenwich */
        int     tz_dsttime;     /* type of dst correction to apply */
 };
+
 .Ed
 .Pp
 The 
 .Ed
 .Pp
 The 
@@ -111,7 +123,7 @@ the appropriate part of the year.
 .Pp
 Only the super-user may set the time of day or time zone.
 If the system securelevel is greater than 1 (see
 .Pp
 Only the super-user may set the time of day or time zone.
 If the system securelevel is greater than 1 (see
-.Xr init 8 ),
+.Xr launchd 8 ),
 the time may only be advanced.
 This limitation is imposed to prevent a malicious super-user
 from setting arbitrary time stamps on files.
 the time may only be advanced.
 This limitation is imposed to prevent a malicious super-user
 from setting arbitrary time stamps on files.