freebsd-dev/lib/libc
Peter Wemm ee4dc2a402 struct tm.tm_year is listed as 'years since 1900', and is signed. On
64 bit systems, years roughly -2^31 through 2^31 can be represented in
time_t without any trouble.  32 bit time_t systems only range from
roughly 1902 through 2038.  As a consequence, none of the date munging
code for all the various calendar tweaks before then is present.  There
are other problems including the fact that there was no 'year zero' and
so on.  So rather than get excited about trying to figure out when the
calendar jumped by two weeks etc, simply disallow negative (ie: prior to
1900) years.

This happens to have an important side effect.  If you bzero a 'struct
tm', it corresponds to 'Jan 0, 1900, 00:00 GMT'.  This happens to be
representable (after canonification) in 64 bit time_t space.  Zero tm
structs are generally an error and mktime normally returns -1 for them.
Interestingly, it tries to canonify the 'jan 0' to 'dec 31, 1899', ie:
year -1.  This conveniently trips the negative year test above, which
means we can trivially detect the null 'tm' struct.

This actually tripped up code at work. :-/  (Don't ask)
2004-08-24 00:15:37 +00:00
..
alpha Fix alpha build and add __FBSDID. 2004-08-16 08:12:29 +00:00
amd64 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
arm Replace seven nominally MD implementations of frexp() that are broken 2004-07-18 21:23:39 +00:00
compat-43 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
db Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
gdtoa Updated manh shift constant type to 'ULL' for PPC to fix 2004-01-21 04:51:50 +00:00
gen Make sure we allocate at least enough space for the TCB for variant I TLS. 2004-08-23 15:30:05 +00:00
gmon Document the location of the header file which declares the function 2004-06-14 18:41:24 +00:00
i386 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
ia64 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
include Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
locale Re-word warning about the UTF2 encoding, taking care to use the word 2004-08-21 08:08:29 +00:00
net Bump the document date, since the content changed today. 2004-08-06 15:29:54 +00:00
nls Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
posix1e Fix the NAME section making whatis(1) happy in particular. 2004-07-05 17:12:53 +00:00
powerpc Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
quad libc_r wasn't so tied to libc for 22 months. 2002-11-18 09:50:57 +00:00
regex Update paths to reg*.c and regex2.h. Add a target to build regex.h. 2004-07-19 08:48:17 +00:00
rpc Avoid using void pointers in additive expressions. 2004-08-13 23:22:38 +00:00
softfloat Import the softfloat emulation library, needed for FreeBSD/arm right now. 2004-05-14 12:13:06 +00:00
sparc64 Add support for TLS in statically linked programs. 2004-08-15 16:18:52 +00:00
stdio Fix an off-by-one bug that caused the first character of the buffer to 2004-08-06 17:00:09 +00:00
stdlib Reword recent addition about memory moving. 2004-08-19 16:34:31 +00:00
stdtime struct tm.tm_year is listed as 'years since 1900', and is signed. On 2004-08-24 00:15:37 +00:00
string Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
sys Document the MNT_SNAPSHOT mount flag with a cross-reference 2004-08-13 14:33:03 +00:00
uuid Remove stale DCE 1.1 pointers to the IBM site. The URLs aren't valid 2003-08-08 19:18:43 +00:00
xdr We use __arm__, not __arm32__. 2004-05-14 11:51:22 +00:00
yp Back out the `hiding' of strlcpy and strlcat. Several people 2003-05-01 19:03:14 +00:00
Makefile Import the FreeBSD/arm libc bits. 2004-05-14 12:04:31 +00:00