From: Daan De Meyer Date: Sun, 15 Mar 2020 20:10:37 +0000 (+0100) Subject: sd-bus: Add sd_bus_set_fd documentation along with some cleanups. X-Git-Tag: v246-rc1~750 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aaf6c75061109e6e6a8049cef93703e079d6b4f3;p=thirdparty%2Fsystemd.git sd-bus: Add sd_bus_set_fd documentation along with some cleanups. --- diff --git a/man/sd_bus_get_fd.xml b/man/sd_bus_get_fd.xml index 6a022b1a190..213d1390199 100644 --- a/man/sd_bus_get_fd.xml +++ b/man/sd_bus_get_fd.xml @@ -22,6 +22,7 @@ sd_bus_get_fd + sd_bus_set_fd sd_bus_get_events sd_bus_get_timeout @@ -37,6 +38,13 @@ sd_bus *bus + + int sd_bus_set_fd + sd_bus *bus + int input_fd + int output_fd + + int sd_bus_get_events sd_bus *bus @@ -57,8 +65,13 @@ object. This descriptor can be used with poll3 or a similar function to wait for I/O events on the specified bus connection object. If the bus object was configured with the - sd_bus_set_fd3 function, then - the input_fd file descriptor used in that call is returned. + sd_bus_set_fd() function, then the input_fd file descriptor used in + that call is returned. + + sd_bus_set_fd() sets the file descriptors used to communicate from a message bus + object. Both input_fd and output_fd must be valid file descriptors. + The same file descriptor may be used as both the input and the output file descriptor. This function must be called + before the bus is started. sd_bus_get_events() returns the I/O events to wait for, suitable for passing to poll() or a similar call. Returns a combination of POLLIN, @@ -96,14 +109,17 @@ Return Value - sd_bus_get_fd() returns the file descriptor used for communication, or a negative - errno-style error code on error. + On success, sd_bus_get_fd() returns the file descriptor used for communication. On failure, + it returns a negative errno-style error code. + + On success, sd_bus_set_fd() returns a non-negative integer. On failure, it returns a + negative errno-style error code. - sd_bus_get_events() returns the I/O event mask to use for I/O event watching, or a - negative errno-style error code on error. + On success, sd_bus_get_events() returns the I/O event mask to use for I/O event watching. + On failure, it returns a negative errno-style error code. - sd_bus_get_timeout() returns zero or positive on success, or a negative - errno-style error code on error. + On success, sd_bus_get_timeout() returns a non-negative integer. On failure, it returns a + negative errno-style error code. Errors @@ -137,6 +153,19 @@ sd_bus_set_fd(), which sd_bus_get_fd() cannot return. + + + -EBADF + + An invalid file descriptor was passed to sd_bus_set_fd(). + + + + + -ENOPKG + + The bus cannot be resolved. + @@ -149,7 +178,6 @@ systemd1, sd-bus3, - sd_bus_set_fd3, sd_bus_process3, sd_bus_attach_event3, sd_bus_wait3,