From 9809a788e409278a8225b1542813f2e6c5765ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 5 Jan 2022 14:00:59 +0100 Subject: man: add better descriptions of what event handlers do The meaning of the return value, the default handlers, and loop exiting are now described. --- man/sd_event_add_signal.xml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'man/sd_event_add_signal.xml') diff --git a/man/sd_event_add_signal.xml b/man/sd_event_add_signal.xml index 1f0854f6cb..b2aaff87c1 100644 --- a/man/sd_event_add_signal.xml +++ b/man/sd_event_add_signal.xml @@ -64,16 +64,18 @@ source parameter. The signal parameter specifies the numeric signal to be handled (see signal7). - The handler parameter must reference a - function to call when the signal is received or be - NULL. The handler function will be passed - the userdata pointer, which may be chosen - freely by the caller. The handler also receives a pointer to a - signalfd_siginfo structure containing - information about the received signal. See signalfd2 - for further information. + project='man-pages'>signal7). + + The handler parameter is a function to call when the signal is received or + NULL. The handler function will be passed the userdata + pointer, which may be chosen freely by the caller. The handler also receives a pointer to a + signalfd_siginfo structure containing information about the received signal. See + signalfd2 + for further information. The handler may return negative to signal an error (see below), other return + values are ignored. If handler is NULL, a default handler + that calls + sd_event_exit3 will be + used. Only a single handler may be installed for a specific signal. The signal must be blocked in all threads before this function is called (using By default, the event source is enabled permanently (SD_EVENT_ON), but this may be changed with sd_event_source_set_enabled3. - If the handler function returns a negative error code, it will be - disabled after the invocation, even if the - SD_EVENT_ON mode was requested before. + If the handler function returns a negative error code, it will either be disabled after the + invocation, even if the SD_EVENT_ON mode was requested before, or it will cause the + loop to terminate, see + sd_event_source_set_exit_on_failure3. To destroy an event source object use -- cgit v1.2.1