From 4c5e74f71be6dab3d064690672cb84737b198be5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 28 Jul 2020 11:18:08 +0200 Subject: [PATCH] man: document new relative time APIs in sd-event --- man/sd_event_add_time.xml | 53 +++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/man/sd_event_add_time.xml b/man/sd_event_add_time.xml index 8d3511ef63..1fc24c8ab0 100644 --- a/man/sd_event_add_time.xml +++ b/man/sd_event_add_time.xml @@ -51,6 +51,17 @@ void *userdata + + int sd_event_add_time_relative + sd_event *event + sd_event_source **source + clockid_t clock + uint64_t usec + uint64_t accuracy + sd_event_time_handler_t handler + void *userdata + + int sd_event_source_get_time sd_event_source *source @@ -63,6 +74,12 @@ uint64_t usec + + int sd_event_source_set_time_relative + sd_event_source *source + uint64_t usec + + int sd_event_source_get_time_accuracy sd_event_source *source @@ -123,6 +140,11 @@ sd_event_source_set_time(). + sd_event_add_time_relative() is like sd_event_add_time(), + but takes a relative time specification. It's relative to the current time of the event loop iteration, + as returned by + sd_event_now3. + To destroy an event source object use sd_event_source_unref3, but note that the event source is only removed from the event loop @@ -173,17 +195,21 @@ events will be regular, while in the latter case the scheduling latency will keep accumulating on the timer. - sd_event_source_get_time() retrieves - the configured time value of an event source created - previously with sd_event_add_time(). It takes - the event source object and a pointer to a variable to store the - time in, relative to the selected clock's epoch, in µs. + sd_event_source_get_time() retrieves the configured time value of an event + source created previously with sd_event_add_time() or + sd_event_add_time_relative(). It takes the event source object and a pointer to a + variable to store the time in, relative to the selected clock's epoch, in µs. The returned value is + relative to the epoch, even if the event source was created with a relative time via + sd_event_add_time_relative(). - sd_event_source_set_time() changes the - time of an event source created previously with - sd_event_add_time(). It takes the event - source object and a time relative to the selected clock's epoch, - in µs. + sd_event_source_set_time() changes the time of an event source created + previously with sd_event_add_time() or + sd_event_add_time_relative(). It takes the event source object and a time relative + to the selected clock's epoch, in µs. + + sd_event_source_set_time_relative() is similar to + sd_event_source_set_time(), but takes a time relative to the current time of the + event loop iteration, as returned by sd_event_now(). sd_event_source_get_time_accuracy() retrieves the configured accuracy value of an event source @@ -255,6 +281,13 @@ The passed event source is not a timer event source. + + + -EOVERFLOW + + The passed relative time is outside of the allowed range for time values (i.e. the + specified value added to the current time is outside the 64 bit unsigned integer range). +