diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2024-03-27 10:03:37 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2024-03-27 10:03:37 +0000 |
commit | 7534109d13a6cdb22e78d9d4c0a0cd5efd323c45 (patch) | |
tree | 18060c29e7181496e0a5f19a543b2e9835cc0fd6 /lib/libc | |
parent | d9a9f23d0b3f1676d5656b76301341c0037d15b7 (diff) | |
download | src-7534109d13a6cdb22e78d9d4c0a0cd5efd323c45.tar.gz src-7534109d13a6cdb22e78d9d4c0a0cd5efd323c45.zip |
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdtime/ctime.3 | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/libc/stdtime/ctime.3 b/lib/libc/stdtime/ctime.3 index 698a63cfa73d..96b7f775535a 100644 --- a/lib/libc/stdtime/ctime.3 +++ b/lib/libc/stdtime/ctime.3 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2023 +.Dd March 26, 2024 .Dt CTIME 3 .Os .Sh NAME @@ -241,7 +241,21 @@ The .Fn mktime function returns the specified calendar time; if the calendar time cannot be -represented, it returns \-1; +represented, it returns \-1 and sets +.Xr errno 3 +to an appropriate value. +.Pp +Note that \-1 is a valid result (representing one second before +midnight UTC on the evening of 31 December 1969), so this cannot be +relied upon to indicate success or failure; instead, +.Fa tm_wday +and / or +.Fa tm_yday +should be set to an out-of-bounds value (e.g. \-1) prior to calling +.Fn mktime +or +.Fn timegm +and checked after the call. .Pp The .Fn difftime |