Section: sd_bus_attach_event (3)
sd_bus_attach_event, sd_bus_detach_event, sd_bus_get_event - Attach a bus connection object to an event loop
int sd_bus_attach_event(sd_bus *bus, sd_event *e, int priority);
int sd_bus_detach_event(sd_bus *bus);
sd_event *sd_bus_get_event(sd_bus *bus);
attaches the specified bus connection object to an
event loop object at the specified priority (see
for details on event loop priorities). When a bus connection object is attached to an event loop incoming messages will be automatically read and processed, and outgoing messages written, whenever the event loop is run. When the event loop is about to terminate, the bus connection is automatically flushed and closed (see
for details on this). By default bus connection objects are not attached to any event loop. When a bus connection object is attached to one it is not necessary to invoke
as this functionality is handled automatically by the event loop.
detaches a bus object from its event loop.
returns the event loop object the specified bus object is currently attached to, or
if it is currently not attached to any.
is only one of three supported ways to implement I/O event handling for bus connections. Alternatively use
for hooking up a bus connection object with external or manual event loops. Or use
as a simple synchronous, blocking I/O waiting call.
return 0 or a positive integer. On failure, they return a negative errno-style error code.
returns an event loop object or
Returned errors may indicate the following problems:
The bus connection has been created in a different process.
These APIs are implemented as a shared library, which can be compiled and linked to with the