Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/time markup improvements, document ctype_r, time_t ...



details:   https://anonhg.NetBSD.org/src/rev/3a19929c74a9
branches:  trunk
changeset: 758226:3a19929c74a9
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Oct 27 19:16:04 2010 +0000

description:
markup improvements, document ctype_r, time_t is not a "long integer"

diffstat:

 lib/libc/time/ctime.3 |  21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 20d4612cffb4 -r 3a19929c74a9 lib/libc/time/ctime.3
--- a/lib/libc/time/ctime.3     Wed Oct 27 18:51:34 2010 +0000
+++ b/lib/libc/time/ctime.3     Wed Oct 27 19:16:04 2010 +0000
@@ -1,5 +1,5 @@
-.\"    $NetBSD: ctime.3,v 1.32 2010/05/15 13:54:52 pgoyette Exp $
-.Dd February 2, 2010
+.\"    $NetBSD: ctime.3,v 1.33 2010/10/27 19:16:04 christos Exp $
+.Dd October 27, 2010
 .Dt CTIME 3
 .Os
 .Sh NAME
@@ -41,7 +41,9 @@
 .Fn mktime "struct tm *tm"
 .Sh DESCRIPTION
 .Fn ctime
-converts a long integer, pointed to by
+converts a 
+.Tp time_t ,
+pointed to by
 .Fa clock ,
 representing the time in seconds since
 00:00:00 UTC, 1970-01-01,
@@ -56,7 +58,15 @@
 software that expects exactly 26 bytes of output will mistakenly output
 misleading values for out-of-range years.
 .Pp
-.Fn Localtime
+.Fn ctime_r
+is similar to
+.Fn ctime ,
+except it places the result of the convertion on the
+.Fa buf
+argument which should be 26 or more bytes long, instead of using a global
+static buffer.
+.Pp
+.Fn localtime
 and
 .Fn gmtime
 return pointers to
@@ -99,7 +109,8 @@
 .Pp
 .Fn asctime
 converts a time value contained in a
-``tm'' structure to a string,
+.Dq tm
+structure to a string,
 as shown in the above example,
 and returns a pointer to the string.
 .Pp



Home | Main Index | Thread Index | Old Index