summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man3/sd_event_now.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
commitfc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch)
treece1e3bce06471410239a6f41282e328770aa404a /upstream/debian-unstable/man3/sd_event_now.3
parentInitial commit. (diff)
downloadmanpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz
manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-unstable/man3/sd_event_now.3')
-rw-r--r--upstream/debian-unstable/man3/sd_event_now.3102
1 files changed, 102 insertions, 0 deletions
diff --git a/upstream/debian-unstable/man3/sd_event_now.3 b/upstream/debian-unstable/man3/sd_event_now.3
new file mode 100644
index 00000000..8ecffe6a
--- /dev/null
+++ b/upstream/debian-unstable/man3/sd_event_now.3
@@ -0,0 +1,102 @@
+'\" t
+.TH "SD_EVENT_NOW" "3" "" "systemd 255" "sd_event_now"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+sd_event_now \- Retrieve current event loop iteration timestamp
+.SH "SYNOPSIS"
+.sp
+.ft B
+.nf
+#include <systemd/sd\-event\&.h>
+.fi
+.ft
+.HP \w'int\ sd_event_now('u
+.BI "int sd_event_now(sd_event\ *" "event" ", clockid_t\ " "clock" ", uint64_t\ *" "usec" ");"
+.SH "DESCRIPTION"
+.PP
+\fBsd_event_now()\fR
+returns the time when the most recent event loop iteration began\&. A timestamp is taken right after returning from the event sleep, and before dispatching any event sources\&. The
+\fIevent\fR
+parameter specifies the event loop object to retrieve the timestamp from\&. The
+\fIclock\fR
+parameter specifies the clock to retrieve the timestamp for, and is one of
+\fBCLOCK_REALTIME\fR
+(or equivalently
+\fBCLOCK_REALTIME_ALARM\fR),
+\fBCLOCK_MONOTONIC\fR, or
+\fBCLOCK_BOOTTIME\fR
+(or equivalently
+\fBCLOCK_BOOTTIME_ALARM\fR), see
+\fBclock_gettime\fR(2)
+for more information on the various clocks\&. The retrieved timestamp is stored in the
+\fIusec\fR
+parameter, in μs since the clock\*(Aqs epoch\&. If this function is invoked before the first event loop iteration, the current time is returned, as reported by
+\fBclock_gettime()\fR\&. To distinguish this case from a regular invocation the return value will be positive, and zero when the returned timestamp refers to an actual event loop iteration\&.
+.SH "RETURN VALUE"
+.PP
+If the first event loop iteration has not run yet
+\fBsd_event_now()\fR
+writes current time to
+\fIusec\fR
+and returns a positive return value\&. Otherwise, it will write the requested timestamp to
+\fIusec\fR
+and return 0\&. On failure, the call returns a negative errno\-style error code\&.
+.SS "Errors"
+.PP
+Returned values may indicate the following problems:
+.PP
+\fB\-EINVAL\fR
+.RS 4
+An invalid parameter was passed\&.
+.RE
+.PP
+\fB\-EOPNOTSUPP\fR
+.RS 4
+Unsupported clock type\&.
+.RE
+.PP
+\fB\-ECHILD\fR
+.RS 4
+The event loop object was created in a different process, library or module instance\&.
+.RE
+.SH "NOTES"
+.PP
+Functions described here are available as a shared library, which can be compiled against and linked to with the
+\fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
+file\&.
+.PP
+The code described here uses
+\fBgetenv\fR(3), which is declared to be not multi\-thread\-safe\&. This means that the code calling the functions described here must not call
+\fBsetenv\fR(3)
+from a parallel thread\&. It is recommended to only do calls to
+\fBsetenv()\fR
+from an early phase of the program when no other threads have been started\&.
+.SH "HISTORY"
+.PP
+\fBsd_event_now()\fR
+was added in version 229\&.
+.SH "SEE ALSO"
+.PP
+\fBsystemd\fR(1),
+\fBsd-event\fR(3),
+\fBsd_event_new\fR(3),
+\fBsd_event_add_time\fR(3),
+\fBclock_gettime\fR(2)