diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/gettimeofday.2 | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/libc/sys/gettimeofday.2 b/lib/libc/sys/gettimeofday.2 index 3f32e7b6fbf..d12078671bc 100644 --- a/lib/libc/sys/gettimeofday.2 +++ b/lib/libc/sys/gettimeofday.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: gettimeofday.2,v 1.30 2019/01/18 05:03:42 cheloha Exp $ +.\" $OpenBSD: gettimeofday.2,v 1.31 2019/09/04 14:27:55 cheloha Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)gettimeofday.2 8.2 (Berkeley) 5/26/95 .\" -.Dd $Mdocdate: January 18 2019 $ +.Dd $Mdocdate: September 4 2019 $ .Dt GETTIMEOFDAY 2 .Os .Sh NAME @@ -43,15 +43,9 @@ .Ft int .Fn settimeofday "const struct timeval *tp" "const struct timezone *tzp" .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 +The system's notion of the current Greenwich time is obtained with the .Fn gettimeofday -call, and set with the +call and set with the .Fn settimeofday call. The time is expressed in seconds and microseconds @@ -61,18 +55,12 @@ may be updated continuously or in .Dq ticks . If .Fa tp -or -.Fa tzp is .Dv NULL , -the associated time -information will not be returned or set. -.Pp -The structures pointed to by +the time will not be returned or set. +The structure pointed to by .Fa tp -and -.Fa tzp -are defined in +is defined in .In sys/time.h as: .Bd -literal @@ -80,22 +68,34 @@ struct timeval { time_t tv_sec; /* seconds since Jan. 1, 1970 */ suseconds_t tv_usec; /* and microseconds */ }; - -struct timezone { - int tz_minuteswest; /* of Greenwich */ - int tz_dsttime; /* type of dst correction to apply */ -}; .Ed .Pp The -.Fa timezone -structure indicates the local time zone -(measured in minutes of time westward from Greenwich), -and a flag that, if nonzero, indicates that -Daylight Saving time applies locally during -the appropriate part of the year. +.Fa tzp +parameter is historical and timezone information is no longer +tracked by the system. +All code should pass +.Dv NULL +for +.Fa tzp . +For +.Fn gettimeofday , +if +.Fa tzp +is +.Pf non- Dv NULL +an empty +.Dv timezone +structure will be returned. +For +.Fn settimeofday , +if +.Fa tzp +is +.Pf non- Dv NULL +its contents are ignored. .Pp -Only the superuser may set the time of day or time zone. +Only the superuser may set the time of day. If the system securelevel is greater than 1 (see .Xr init 8 ) , the time may only be advanced. |