Re: [PATCH] Clean up obsolete information in gettimeofday.2

2017-05-11 Thread Todd C. Miller
On Sat, 29 Apr 2017 23:05:45 +0900, Bryan Linton wrote:

> Is this worth deleting now that struct timezone *tzp is no longer
> used?

Actually, gettimeofday(2) will fill in struct timezone *tzp if it
is non-NULL.  It is still possible to set the time zone via the
TIMEZONE kernel option.  However, it is only used when the system's
real time clock is not set to UTC.  See options(4) for info.

It is also possible to set the real time clock's UTC offset via
settimeofday(2).

I'll admit that this is not documented very well.

 - todd



[PATCH] Clean up obsolete information in gettimeofday.2

2017-04-29 Thread Bryan Linton
Is this worth deleting now that struct timezone *tzp is no longer
used?

I was originally going to send a small diff changing only the line
that read, "If tp or tzp is NULL, the associated time information
will not be returned or set" since gettimeofday(, NULL) works
exactly as one would expect.

I thought that it might be worth pruning this now, but if it's
still worth keeping the information around, I don't have strong
objection against keeping it either.

-- 
Bryan

Index: gettimeofday.2
===
RCS file: /cvs/src/lib/libc/sys/gettimeofday.2,v
retrieving revision 1.29
diff -u -r1.29 gettimeofday.2
--- gettimeofday.2  10 Sep 2015 17:55:21 -  1.29
+++ gettimeofday.2  29 Apr 2017 14:00:07 -
@@ -61,18 +61,14 @@
 .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 structure pointed to by
 .Fa tp
-and
-.Fa tzp
-are defined in
+is defined in
 .In sys/time.h
 as:
 .Bd -literal
@@ -80,20 +76,7 @@
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.
 .Pp
 Only the superuser may set the time of day or time zone.
 If the system securelevel is greater than 1 (see