diff options
author | Mattias Andrée <maandree@kth.se> | 2021-02-26 17:30:12 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-02-26 17:30:12 +0100 |
commit | dde83349da01f4b2d6a2e4182fc7a3cc627745f6 (patch) | |
tree | 171e9bfee1056d452174663c3b2ce5fcbf288e6b /man3/libsimple_localtime.3 | |
parent | Add tests (diff) | |
download | libsimple-dde83349da01f4b2d6a2e4182fc7a3cc627745f6.tar.gz libsimple-dde83349da01f4b2d6a2e4182fc7a3cc627745f6.tar.bz2 libsimple-dde83349da01f4b2d6a2e4182fc7a3cc627745f6.tar.xz |
Add libsimple_[e[n]]{local,gm}time, remove dates from man pages, and add blank lines between sections in man pages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | man3/libsimple_localtime.3 | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/man3/libsimple_localtime.3 b/man3/libsimple_localtime.3 new file mode 100644 index 0000000..0f6aa19 --- /dev/null +++ b/man3/libsimple_localtime.3 @@ -0,0 +1,133 @@ +.TH LIBSIMPLE_LOCALTIME 3 libsimple +.SH NAME +libsimple_localtime \- get the current local time with leap second adjustment + +.SH SYNOPSIS +.nf +#include <libsimple.h> + +int libsimple_localtime(struct tm *\fItm\fP, struct timespec *\fIts\fP); +static inline void libsimple_enlocaltime(int \fIstatus\fPstruct tm *\fItm\fP, struct timespec *\fIts\fP); +static inline void libsimple_elocaltime(struct tm *\fItm\fP, struct timespec *\fIts\fP); +.fi +.PP +Link with +.IR \-lsimple . + +.SH DESCRIPTION +The +.BR libsimple_localtime (), +.BR libsimple_enlocaltime (), +and +.BR libsimple_elocaltime () +functions get the current local time, with adjustments +for leap seconds insertions and deletions. +.PP +The +.BR libsimple_enlocaltime () +and +.BR libsimple_elocaltime () +functions will terminate the process on failure. +On failure, the process's exit value will be +.I status +if the +.BR libsimple_enlocaltime () +function is used or +.IR libsimple_default_failure_exit (3) +if the +.BR libsimple_elocaltime () +fucntion is used. +.PP +The local time is stored in +.IR *tm , +and the POSIX time (not timezone adjusted), +with leap second adjustments, is stored in +.I *ts +unless +.I ts +is +.IR NULL . +.I tm +may +.I not +be +.RI NULL . + +.SH RETURN VALUE +The +.BR libsimple_localtime () +function return a 0 upon successful completion; +otherwise the they return -1 and set +.I errno +to indicate the error. The +.BR libsimple_enlocaltime () +and +.BR libsimple_elocaltime () +functions terminate the processes on failure. + +.SH ERRORS +The +.BR libsimple_localtime () +function will fail for the reasons specified for the +.BR localtime_r (3) +function. +.PP +The +.BR libsimple_enlocaltime () +and +.BR libsimple_elocaltime () +functions will terminate the process on failure. + +.SH ATTRIBUTES +For an explanation of the terms used in this section, see +.BR attributes (7). +.TS +allbox; +lb lb lb +l l l. +Interface Attribute Value +T{ +.BR libsimple_localtime (), +.br +.BR libsimple_enlocaltime (), +.br +.BR libsimple_elocaltime () +T} Thread safety MT-Safe +T{ +.BR libsimple_localtime (), +.br +.BR libsimple_enlocaltime (), +.br +.BR libsimple_elocaltime () +T} Async-signal safety AS-Safe +T{ +.BR libsimple_localtime (), +.br +.BR libsimple_enlocaltime (), +.br +.BR libsimple_elocaltime () +T} Async-cancel safety AC-Safe +.TE + +.SH EXAMPLES +None. + +.SH APPLICATION USAGE +None. + +.SH RATIONALE +None. + +.SH FUTURE DIRECTIONS +None. + +.SH NOTES +None. + +.SH BUGS +None. + +.SH SEE ALSO +.BR libsimple_gmtime (3), +.BR ntp_adjtime (2), +.BR localtime_r (3) |