1
0
mirror of https://github.com/openbsd/src.git synced 2026-04-23 05:34:18 +00:00

Document RETURN value for timegm(3)

APIs with in-band errors that conflate the error with a legitimate return
value are about the worst you can get. Near and dear to my heart is the API
aptly described as "gibbering eidritch horror" by beck: ASN1_INTEGER_get(3).
Adapt the wording of its RETURN VALUES to timegm() and mktime(), for which
Dec 31, 1969 at 23:59:59 will yield the error return -1 and thereby errata.

Missing docs pointed out by claudio a while back and yesterday by deraadt

ok deraadt millert
This commit is contained in:
tb
2026-04-13 16:01:54 +00:00
parent b09aaa95e2
commit a0d7485e83

View File

@@ -1,7 +1,7 @@
.\" $OpenBSD: ctime.3,v 1.50 2025/11/20 10:58:11 tb Exp $
.\" $OpenBSD: ctime.3,v 1.51 2026/04/13 16:01:54 tb Exp $
.\"
.\"
.Dd $Mdocdate: November 20 2025 $
.Dd $Mdocdate: April 13 2026 $
.Dt CTIME 3
.Os
.Sh NAME
@@ -278,9 +278,12 @@ The functions
and
.Fn gmtime_r
return NULL on error.
The function
The functions
.Fn mktime
returns \-1 on error.
and
.Fn timegm
return \-1 on error,
which is ambiguous because \-1 is a legitimate conversion result.
.Sh FILES
.Bl -tag -width "/usr/share/zoneinfo/posixrules" -compact
.It Pa /usr/share/zoneinfo