X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..935ed37a5c468c8a1c07408573c08b8b7ef80e8b:/bsd/man/man2/gettimeofday.2?ds=sidebyside diff --git a/bsd/man/man2/gettimeofday.2 b/bsd/man/man2/gettimeofday.2 index febc61dcd..67f2760c6 100644 --- a/bsd/man/man2/gettimeofday.2 +++ b/bsd/man/man2/gettimeofday.2 @@ -43,9 +43,15 @@ .Sh SYNOPSIS .Fd #include .Ft int -.Fn gettimeofday "struct timeval *tp" "struct timezone *tzp" +.Fo gettimeofday +.Fa "struct timeval *restrict tp" +.Fa "void *restrict tzp" +.Fc .Ft int -.Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" +.Fo settimeofday +.Fa "const struct timeval *tp" +.Fa "const struct timezone *tzp" +.Fc .Sh DESCRIPTION .Bf -symbolic Note: timezone is no longer used; this information is kept outside @@ -77,8 +83,8 @@ as: .Pp .Bd -literal struct timeval { - long tv_sec; /* seconds since Jan. 1, 1970 */ - long tv_usec; /* and microseconds */ + time_t tv_sec; /* seconds since Jan. 1, 1970 */ + suseconds_t tv_usec; /* and microseconds */ }; struct timezone { @@ -88,6 +94,14 @@ struct timezone { .Ed .Pp The +.Fa timeval +structure specifies a time value in seconds and microseconds. +The values in +.Fa timeval +are opaque types whose length may vary on different machines; +depending on them to have any given length may lead to errors. +.Pp +The .Fa timezone structure indicates the local time zone (measured in minutes of time westward from Greenwich), @@ -118,10 +132,24 @@ An argument address referenced invalid memory. .It Bq Er EPERM A user other than the super-user attempted to set the time. .El +.Sh LEGACY SYNOPSIS +.Fd #include +.Pp +.Ft int +.br +.Fo gettimeofday +.Fa "struct timeval *tp" +.Fa "struct timezone *tzp" +.Fc ; +.Pp +The type of +.Fa tzp +has changed. .Sh SEE ALSO .Xr date 1 , .Xr adjtime 2 , .Xr ctime 3 , +.Xr compat 5 , .Xr timed 8 .Sh HISTORY The