Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time document where tm_zone comes from in the _z ca...



details:   https://anonhg.NetBSD.org/src/rev/b41a059a18c7
branches:  trunk
changeset: 770934:b41a059a18c7
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 02 23:06:08 2011 +0000

description:
document where tm_zone comes from in the _z calls.

diffstat:

 lib/libc/time/ctime.3 |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r 9004bcba170c -r b41a059a18c7 lib/libc/time/ctime.3
--- a/lib/libc/time/ctime.3     Wed Nov 02 23:05:52 2011 +0000
+++ b/lib/libc/time/ctime.3     Wed Nov 02 23:06:08 2011 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ctime.3,v 1.45 2011/11/02 19:59:40 apb Exp $
+.\" $NetBSD: ctime.3,v 1.46 2011/11/02 23:06:08 christos Exp $
 .\"
 .\" XXX: License missing?
 .\"
@@ -436,9 +436,11 @@
 Rest of the functions conform to
 .St -p1003.1-2008 .
 .Sh CAVEATS
-The return values point to static data; the data is overwritten by
+The functions that do not take an explicit
+.Ft timezone_t
+argument return values point to static data; the data is overwritten by
 each call.
-The
+For the above functions the
 .Fa tm_zone
 field of a returned
 .Va "struct tm"
@@ -446,6 +448,18 @@
 will also be overwritten at the next call
 (and by calls to
 .Xr tzset 3 ) .
+The functions that do take an explicit
+.Ft timezone_t
+argument and set the fields of a supplied
+.Va "struct tm"
+should not call
+.Fn tzfree
+since the
+.Fa tm_zone
+field of the
+.Va "struct tm"
+points to data allocated by
+.Fn tzalloc .
 .Pp
 The
 .Fn asctime



Home | Main Index | Thread Index | Old Index