ctime.3: RETURN VALUE: describe return values more explicitly

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2016-11-06 03:26:30 -07:00
parent aab65e59ef
commit f5633e8dc6
1 changed files with 41 additions and 4 deletions

View File

@ -275,10 +275,47 @@ returns
and does not alter the
members of the broken-down time structure.
.SH RETURN VALUE
Each of these functions returns the value described, or NULL
(\-1 in case of
.BR mktime ())
in case an error was detected.
On success,
.BR gmtime ()
and
.BR localtime ()
return a pointer to a
.IR "struct\ tm" .
On success,
.BR gmtime_r ()
and
.BR localtime_r ()
return the address of the structure pointed to by
.IR result .
On success,
.BR asctime ()
and
.BR ctime ()
return a pointer to a string.
On success,
.BR asctime_r ()
and
.BR ctime_r ()
return a pointer to the string pointed to by
.IR buf .
On success,
.BR mktime ()
returns the calandar time (seconds since the Epoch),
expressed as value of type
.IR time_t .
On error,
.BR mktime ()
returns the value
.IR "(time_t)\ -1" .
The remaining functions return NULL on error.
On error,
.I errno
is set to indicate the cause of the error.
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).