On Mon, Apr 23, 2001 at 12:27:58AM -0700, François Gouget wrote:
Btw, the Linux localtime documentation sucks. It's even worse than the MS one!!!
Err, fix it ? ;-)
Really, what is an Open Source programmer supposed to do when he realizes that something sucks ?
Food for thought,
On Mon, 23 Apr 2001, Andreas Mohr wrote:
On Mon, Apr 23, 2001 at 12:27:58AM -0700, François Gouget wrote:
Btw, the Linux localtime documentation sucks. It's even worse than the MS one!!!
Err, fix it ? ;-)
Really, what is an Open Source programmer supposed to do when he realizes that something sucks ?
Would that do it?
--- cut here --- --- ctime.3.orig Mon Apr 23 00:47:46 2001 +++ ctime.3 Mon Apr 23 00:50:24 2001 @@ -139,7 +139,9 @@ information about the current time zone, \fItimezone\fP with the difference between Coordinated Universal Time (UTC) and local standard time in seconds, and \fIdaylight\fP to a non-zero value if standard US daylight -savings time rules apply. +savings time rules apply. The return value points to a statically +allocated \fItm\fP structure which might be overwritten by subsequent +calls to any of the date and time functions. .PP The \fBasctime()\fP function converts the broken-down time value \fItimeptr\fP into a string with the same format as \fBctime()\fP. --- cut here ---
I wonder where I should send it. Since I'm lazy I guess I will just send it over to Debian where it will join the 2+ years old bug reports for the manpages-dev package. (maybe I should check the source first though :-/)
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ The software said it requires Win95 or better, so I installed Linux.
Francois Gouget fgouget@free.fr wrote:
[patch for glibc manpage]
I wonder where I should send it. Since I'm lazy I guess I will just send it over to Debian where it will join the 2+ years old bug reports for the manpages-dev package. (maybe I should check the source first though :-/)
The ctime manpage here is from 1996 (glibc-2.0.7 I guess), it came with the distribution. I don't see any glibc-2.1.3 or glibc-2.2 manpages, only texinfo/info files. Maybe they don't maintain man pages anymore.
The localtime info from glibc-2.2 says:
| - Function: struct tm * localtime (const time_t *TIME) | The `localtime' function converts the simple time pointed to by | TIME to broken-down time representation, expressed relative to the | user's specified time zone. | | The return value is a pointer to a static broken-down time | structure, which might be overwritten by subsequent calls to | `ctime', `gmtime', or `localtime'. (But no other library function | overwrites the contents of this object.) | | The return value is the null pointer if TIME cannot be represented | as a broken-down time; typically this is because the year cannot | fit into an `int'. | | Calling `localtime' has one other effect: it sets the variable | `tzname' with information about the current time zone. *Note Time | Zone Functions::. | | Using the `localtime' function is a big problem in multi-threaded | programs. The result is returned in a static buffer and this is used in | all threads. POSIX.1c introduced a variant of this function.
And then follows the description for localtime_r().
Regards... Michael
On Mon, 23 Apr 2001, Michael Mauch wrote:
Francois Gouget fgouget@free.fr wrote:
[...]
The ctime manpage here is from 1996 (glibc-2.0.7 I guess), it came with the distribution. I don't see any glibc-2.1.3 or glibc-2.2 manpages, only texinfo/info files. Maybe they don't maintain man pages anymore.
The localtime info from glibc-2.2 says: | | - Function: struct tm * localtime (const time_t *TIME) | The `localtime' function converts the simple time pointed to by | TIME to broken-down time representation, expressed relative to the | user's specified time zone. | | The return value is a pointer to a static broken-down time | structure, which might be overwritten by subsequent calls to | `ctime', `gmtime', or `localtime'. (But no other library function | overwrites the contents of this object.) | | The return value is the null pointer if TIME cannot be represented | as a broken-down time; typically this is because the year cannot | fit into an `int'. | | Calling `localtime' has one other effect: it sets the variable | `tzname' with information about the current time zone. *Note Time | Zone Functions::. | | Using the `localtime' function is a big problem in multi-threaded | programs. The result is returned in a static buffer and this is used in | all threads. POSIX.1c introduced a variant of this function.
And then follows the description for localtime_r().
Ah, well, that's much better. It great even. So it's not glibc's fault.
<venting> And, wonder of wonders, I even have it on my system. It's provided by glibc-doc in 'file:/usr/share/doc/glibc-doc/html/chapters_20.html'. But of course!!! That's such an obvious place to look at. Who would be so naive as to type 'man localtime'! Of course you won't find it if you go to the index page because it's all screwed up. The best way is to 'grep -l localtime /usr/share/doc/glibc-doc/html/*.html'. And it's wonderfully inconsistent with the man pages provided by the manpages-dev package. But I'm sure this will be fixed in 3-4 years time. I love Debian. </venting>
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ War doesn't determine who's right. War determines who's left.