summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2020-04-24 10:32:33 +0000
committerschwarze <schwarze@openbsd.org>2020-04-24 10:32:33 +0000
commit009de644abbff9cfa7bd4316032ffd754345411e (patch)
tree802f73858b63a2a6143fa797fa4dc60dd52f77e7 /lib/libc
parentbcmgpio(4) (diff)
downloadwireguard-openbsd-009de644abbff9cfa7bd4316032ffd754345411e.tar.xz
wireguard-openbsd-009de644abbff9cfa7bd4316032ffd754345411e.zip
Remove the deprecation notice for timegm().
The tzcode package marked it dprecated in the late 1980ies but it is universally supported and here to stay. Triggered by a question from Rodrigo <hruodr at gmail dot com> on misc@. William Ahern <william at 25thandclement dot com> listed a number of sound arguments why it shouldn't be considered deprecated, in particular that there is no better alternative, in particular none that is thread-safe. While here, fix the non-standard section name "NOTES", add the missing STANDARDS section and provide additional information in the HISTORY section, based on inspection of C89, C11, POSIX 2008, UNIX v4 and v5 at TUHS, Tahoe and Reno at the CSRG archives, amd the SunOS 3.5 and 4.0 manuals on bitsavers. Reasearch on tzcode and SunOS history done by millert@. OK millert@ on an earlier version of this patch, and deraadt@ agrees with the general direction.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/time/ctime.361
1 files changed, 57 insertions, 4 deletions
diff --git a/lib/libc/time/ctime.3 b/lib/libc/time/ctime.3
index 284f5f0d3b2..5000b143c4b 100644
--- a/lib/libc/time/ctime.3
+++ b/lib/libc/time/ctime.3
@@ -1,7 +1,7 @@
-.\" $OpenBSD: ctime.3,v 1.44 2015/09/14 13:08:01 schwarze Exp $
+.\" $OpenBSD: ctime.3,v 1.45 2020/04/24 10:32:33 schwarze Exp $
.\"
.\"
-.Dd $Mdocdate: September 14 2015 $
+.Dd $Mdocdate: April 24 2020 $
.Dt CTIME 3
.Os
.Sh NAME
@@ -201,7 +201,7 @@ with a negative value for
.Fa tm_isdst .
.Pp
.Fn timegm
-is a deprecated interface that converts the broken-down time, as returned by
+converts the broken-down time, as returned by
.Fn gmtime ,
into a calendar time value with the same encoding as that of the values
returned by the
@@ -295,12 +295,65 @@ UTC leap seconds are loaded from
.Xr tzset 3 ,
.Xr tzfile 5 ,
.Xr zic 8
+.Sh STANDARDS
+The functions
+.Fn asctime ,
+.Fn ctime ,
+.Fn difftime ,
+.Fn gmtime ,
+.Fn localtime ,
+and
+.Fn mktime
+conform to
+.St -ansiC .
+.Pp
+The functions
+.Fn asctime_r ,
+.Fn ctime_r ,
+.Fn gmtime_r ,
+and
+.Fn localtime_r
+conform to
+.St -p1003.1-2008 .
+.Pp
+The functions
+.Fn timegm
+and
+.Fn timelocal
+are extensions to these standards.
.Sh HISTORY
A
.Fn ctime
function first appeared in
.At v1 .
-.Sh NOTES
+.Pp
+The functions
+.Fn asctime ,
+.Fn gmtime ,
+and
+.Fn localtime
+first appeared in
+.At v5 ,
+.Fn difftime
+and
+.Fn mktime
+in
+.Bx 4.3 Reno ,
+and
+.Fn timegm
+and
+.Fn timelocal
+in SunOS 4.0.
+.Pp
+The functions
+.Fn asctime_r ,
+.Fn ctime_r ,
+.Fn gmtime_r ,
+and
+.Fn localtime_r
+have been available since since
+.Ox 2.5 .
+.Sh CAVEATS
The return values
of the non re-entrant functions
point to static data;