'\" t .TH "SD_EVENT_SET_EXIT_ON_IDLE" "3" "" "systemd 259" "sd_event_set_exit_on_idle" .\" ----------------------------------------------------------------- .\" * 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_set_exit_on_idle, sd_event_get_exit_on_idle \- Enable event loop exit\-on\-idle support .SH "SYNOPSIS" .sp .ft B .nf #include .fi .ft .HP \w'int\ sd_event_set_exit_on_idle('u .BI "int sd_event_set_exit_on_idle(sd_event\ *" "event" ", int\ b);" .HP \w'int\ sd_event_get_exit_on_idle('u .BI "int sd_event_get_exit_on_idle(sd_event\ *" "event" ");" .SH "DESCRIPTION" .PP \fBsd_event_set_exit_on_idle()\fR may be used to enable or disable the exit\-on\-idle support in the event loop object specified in the \fIevent\fR parameter\&. If enabled, the event loop will exit with a zero exit code there are no more enabled (\fBSD_EVENT_ON\fR, \fBSD_EVENT_ONESHOT\fR), non\-exit, non\-post event sources\&. .PP \fBsd_event_get_exit_on_idle()\fR may be used to determine whether exit\-on\-idle support was previously requested by a call to \fBsd_event_set_exit_on_idle()\fR with a true \fIb\fR parameter and successfully enabled\&. .SH "RETURN VALUE" .PP On success, \fBsd_event_set_exit_on_idle()\fR and \fBsd_event_get_exit_on_idle()\fR return a non\-zero positive integer if the exit\-on\-idle support was successfully enabled\&. They return zero if the exit\-on\-idle support was explicitly disabled with a false \fIb\fR parameter\&. On failure, they return a negative errno\-style error code\&. .SS "Errors" .PP Returned errors may indicate the following problems: .PP \fB\-ECHILD\fR .RS 4 The event loop has been created in a different process, library or module instance\&. .RE .PP \fB\-EINVAL\fR .RS 4 The passed event loop object was invalid\&. .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_set_exit_on_idle()\fR and \fBsd_event_get_exit_on_idle()\fR were added in version 259\&. .SH "SEE ALSO" .PP \fBsystemd\fR(1), \fBsd-event\fR(3), \fBsd_event_new\fR(3), \fBsd_event_add_io\fR(3), \fBsd_event_add_time\fR(3), \fBsd_event_add_signal\fR(3), \fBsd_event_add_child\fR(3), \fBsd_event_add_inotify\fR(3), \fBsd_event_add_defer\fR(3), \fBsystemd.service\fR(5)