Debian Codegraph @

upstream/debian-unstable/man3/sd_event_set_exit_on_idle.3

raw
1 '\" t
2 .TH "SD_EVENT_SET_EXIT_ON_IDLE" "3" "" "systemd 261~rc3" "sd_event_set_exit_on_idle"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 sd_event_set_exit_on_idle, sd_event_get_exit_on_idle \- Enable event loop exit\-on\-idle support
24 .SH "SYNOPSIS"
25 .sp
26 .ft B
27 .nf
28 #include <systemd/sd\-event\&.h>
29 .fi
30 .ft
31 .HP \w'int\ sd_event_set_exit_on_idle('u
32 .BI "int sd_event_set_exit_on_idle(sd_event\ *" "event" ", int\ b);"
33 .HP \w'int\ sd_event_get_exit_on_idle('u
34 .BI "int sd_event_get_exit_on_idle(sd_event\ *" "event" ");"
35 .SH "DESCRIPTION"
36 .PP
37 \fBsd_event_set_exit_on_idle()\fR
38 may be used to enable or disable the exit\-on\-idle support in the event loop object specified in the
39 \fIevent\fR
40 parameter\&. If enabled, the event loop will exit with a zero exit code there are no more enabled (\fBSD_EVENT_ON\fR,
41 \fBSD_EVENT_ONESHOT\fR), non\-exit, non\-post event sources\&.
42 .PP
43 \fBsd_event_get_exit_on_idle()\fR
44 may be used to determine whether exit\-on\-idle support was previously requested by a call to
45 \fBsd_event_set_exit_on_idle()\fR
46 with a true
47 \fIb\fR
48 parameter and successfully enabled\&.
49 .SH "RETURN VALUE"
50 .PP
51 On success,
52 \fBsd_event_set_exit_on_idle()\fR
53 and
54 \fBsd_event_get_exit_on_idle()\fR
55 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
56 \fIb\fR
57 parameter\&. On failure, they return a negative errno\-style error code\&.
58 .SS "Errors"
59 .PP
60 Returned errors may indicate the following problems:
61 .PP
62 \fB\-ECHILD\fR
63 .RS 4
64 The event loop has been created in a different process, library or module instance\&.
65 .RE
66 .PP
67 \fB\-EINVAL\fR
68 .RS 4
69 The passed event loop object was invalid\&.
70 .RE
71 .SH "NOTES"
72 .PP
73 Functions described here are available as a shared library, which can be compiled against and linked to with the
74 \fBlibsystemd\fR\ \&\fBpkg-config\fR(1)
75 file\&.
76 .PP
77 The code described here uses
78 \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
79 \fBsetenv\fR(3)
80 from a parallel thread\&. It is recommended to only do calls to
81 \fBsetenv()\fR
82 from an early phase of the program when no other threads have been started\&.
83 .SH "HISTORY"
84 .PP
85 \fBsd_event_set_exit_on_idle()\fR
86 and
87 \fBsd_event_get_exit_on_idle()\fR
88 were added in version 259\&.
89 .SH "SEE ALSO"
90 .PP
91 \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)