X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=man%2Fsd_event_run.xml;fp=man%2Fsd_event_run.xml;h=d9ffe46bdaf435672944d68a93ffd60af9a59ae7;hb=42f1ab5009eed71f0d4f83681b8fdbed8664fca3;hp=0000000000000000000000000000000000000000;hpb=02d30981b1bef116caee26ef3229fb910a88a394;p=elogind.git diff --git a/man/sd_event_run.xml b/man/sd_event_run.xml new file mode 100644 index 000000000..d9ffe46bd --- /dev/null +++ b/man/sd_event_run.xml @@ -0,0 +1,182 @@ + + + + + + + + + sd_event_run + systemd + + + + Developer + Tom + Gundersen + teg@jklm.no + + + + + + sd_event_run + 3 + + + + sd_event_run + sd_event_loop + + Run libsystemd event loop + + + + + #include <systemd/sd-event.h> + + + int sd_event_run + sd_event *event + uint64_t timeout + + + + int sd_event_loop + sd_event *event + + + + + + Description + + sd_event_run() can be used to run one + iteration of the event loop of libsystemd. This function waits + until an event to process is available and dispatches a handler + for it. Parameter timeout specifices the + maximum time (in microseconds) to wait. (uint64_t) + -1 may be used to specify an infinite timeout. + + sd_event_loop runs + sd_event_wait in a loop with a timeout of + infinity. This makes it suitable for the main event loop of a + program. + + The event loop object event is + created with + sd_event_new. + Events to wait for and their handlers can be registered with + sd_event_add_time, + sd_event_add_child, + sd_event_add_signal, + sd_event_add_defer, + sd_event_add_exit, + and + sd_event_add_post. + + + For more fine-grained control, + sd_event_prepare, + sd_event_wait, and + sd_event_dispatch may be used. Along with + sd_event_get_fd, those functions make it + possible to integrate the libsystemd loop inside of another event + loop. + + + + Return Value + + On success, these functions return 0 or a positive integer. + On failure, they return a negative errno-style error code. + sd_event_run returns 0 if the event loop is + finished, and a positive value if it can be continued. + + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + Parameter event is + NULL. + + + + -EBUSY + + The event loop object is not in the right + state (see + sd_event_prepare3 + for an explanation of possible states). + + + + -ESTALE + + The event loop is already terminated. + + + + + -ECHILD + + The event loop has been created in a different process. + + + + + + Other errors are possible too. + + + + Notes + + sd_event_run() and + sd_event_loop() are available + as a shared library, which can be compiled and linked to with the + libsystemd pkg-config1 + file. + + + + See Also + + + systemd1, + sd_event_new3, + sd_event_wait3, + sd_event_add_io3, + sd_event_add_time3, + sd_event_add_signal3, + sd_event_add_defer3, + sd_event_add_exit3, + sd_event_add_post3. + + + +