Re: bug introduced in 2.0.34

Andries.Brouwer@cwi.nl
Sun, 18 Oct 1998 21:48:00 +0200 (MET DST)


From alan@lxorguk.ukuu.org.uk Sun Oct 18 17:44:50 1998

> and will not be supported by libc or glibc. Each and
> every occurrence of this field in the kernel source (other
> than the declaration) is a bug.
>
> So, it must be a bad idea to introduce more of these bugs,
> instead of removing the few occurrences that exist.

Well the kernel needs to know if daylight savings is in force or not. I'll
take patches to change this if you want but for most people the above
works, bug or not ;)

Ah, Alan, what a weak argument.

For everybody who does not fiddle explicitly with this tz_dsttime field
it is zero, so if the kernel uses it it makes no difference at all.
Let us grep for tz_dsttime in 2.0.35:

./linux/fs/isofs/util.c: if (sys_tz.tz_dsttime)
./linux/fs/fat/misc.c: if (sys_tz.tz_dsttime) {
./linux/fs/fat/misc.c: if (sys_tz.tz_dsttime) unix_date += 3600;
./linux/fs/ncpfs/dir.c: return time - sys_tz.tz_minuteswest*60 + sys_tz.tz_dsttime*3600;
./linux/fs/ncpfs/dir.c: return time + sys_tz.tz_minuteswest*60 - sys_tz.tz_dsttime*3600;
./linux/include/linux/time.h: int tz_dsttime; /* type of dst correction */

So, the kernel does not set it, but contains five bugs where it is
inspected. How can it be set? Only by the settimeofday() system call.

This was introduced in BSD 4.3. For it, the field tz_dsttime had the
following meaning (quoting from an old man page):

The flag indicating the type of Daylight Saving Time correction
should have one of the following values (as defined in
<sys/time.h>):

0 DST_NONE: Daylight Savings Time not observed
1 DST_USA: United States DST
2 DST_AUST: Australian DST
3 DST_WET: Western European DST
4 DST_MET: Middle European DST
5 DST_EET: Eastern European DST
6 DST_CAN: Canadian DST
7 DST_GB: Great Britain and Eire DST
8 DST_RUM: Rumanian DST
9 DST_TUR: Turkish DST
10 DST_AUSTALT: Australian-style DST with shift in 1986

Note: this flag does *not* indicate whether Daylight Saving Time
is currently in effect.

So far this old man page.
Now you tell me that most people need a new meaning for this field?
A meaning that was not present in BSD software, and is not present
in SunOS, Solaris, IRIX, FreeBSD? What software sets this field?

I hope you understand that I am very sceptical about your `most people'.

Best regards, Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/