Module Name: src
Committed By: christos
Date: Wed Nov 2 23:06:08 UTC 2011
Modified Files:
src/lib/libc/time: ctime.3
Log Message:
document where tm_zone comes from in the _z calls.
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/lib/libc/time/ctime.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/time/ctime.3
diff -u src/lib/libc/time/ctime.3:1.45 src/lib/libc/time/ctime.3:1.46
--- src/lib/libc/time/ctime.3:1.45 Wed Nov 2 15:59:40 2011
+++ src/lib/libc/time/ctime.3 Wed Nov 2 19:06:08 2011
@@ -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 @@ functions conform to
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 @@ points to a static array of characters,
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