Module Name: src Committed By: apb Date: Sat Jan 19 11:56:17 UTC 2013
Modified Files: src/lib/libc/time: ctime.3 Log Message: Document the fact that ctime_rz, localtime_rz, and mktime_z, accept a NULL timezone_t pointer as a reference to UTC, and the fact that tzalloc accepts a NULL zone name. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 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.46 src/lib/libc/time/ctime.3:1.47 --- src/lib/libc/time/ctime.3:1.46 Wed Nov 2 23:06:08 2011 +++ src/lib/libc/time/ctime.3 Sat Jan 19 11:56:17 2013 @@ -1,8 +1,8 @@ -.\" $NetBSD: ctime.3,v 1.46 2011/11/02 23:06:08 christos Exp $ +.\" $NetBSD: ctime.3,v 1.47 2013/01/19 11:56:17 apb Exp $ .\" .\" XXX: License missing? .\" -.Dd November 2, 2011 +.Dd January 19, 2013 .Dt CTIME 3 .Os .Sh NAME @@ -125,7 +125,10 @@ function is similar to but it also takes a .Ft "const timezone_t" argument, as returned by a previous call to -.Fn tzalloc . +.Fn tzalloc , +or a null pointer denoting +Coordinated Universal Time +.Pq Tn UTC . .It Fn difftime "time1" "time2" The .Fn difftime @@ -189,7 +192,10 @@ function is similar to but it also takes a .Ft "const timezone_t" argument, returned by a previous call to -.Fn tzalloc . +.Fn tzalloc , +or a null pointer denoting +Coordinated Universal Time +.Pq Tn UTC . .It Fn mktime "tm" The .Fn mktime @@ -266,7 +272,10 @@ function is similar to but it also takes a .Ft "const timezone_t" argument, returned by a previous call to -.Fn tzalloc . +.Fn tzalloc , +or a null pointer denoting +Coordinated Universal Time +.Pq Tn UTC . .It Fn tzalloc "zone" The .Fn tzalloc @@ -279,6 +288,12 @@ and .Fn mktime_z functions. .Pp +A null pointer may be passed to +.Fn tzalloc +instead of a timezone name, to refer to +Coordinated Universal Time +.Pq Tn UTC . +.Pp Note that instead of setting the environment variable .Va TZ , and globally changing the behavior of the calling program, one can use @@ -376,6 +391,15 @@ object or on failure, setting .Va errno to indicate the error. +It may also return +.Dv NULL +when the +.Fa name +argument is +.Dv NULL , +and this is not an error, but a way of referring to +Coordinated Universal Time +.Pq Tn UTC . .It .Fn tzgetzone function returns string containing the name of the timezone given in