diff --git a/man/rules/meson.build b/man/rules/meson.build index 763863afefb..a48158f5624 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -269,10 +269,7 @@ manpages = [ 'sd_bus_get_current_slot', 'sd_bus_get_current_userdata'], ''], - ['sd_bus_get_fd', - '3', - ['sd_bus_get_events', 'sd_bus_get_timeout', 'sd_bus_set_fd'], - ''], + ['sd_bus_get_fd', '3', ['sd_bus_get_events', 'sd_bus_get_timeout'], ''], ['sd_bus_get_n_queued_read', '3', ['sd_bus_get_n_queued_write'], ''], ['sd_bus_get_name_creds', '3', ['sd_bus_get_owner_creds'], ''], ['sd_bus_get_name_machine_id', '3', [], ''], @@ -430,6 +427,7 @@ manpages = [ 'sd_bus_set_trusted'], ''], ['sd_bus_set_exit_on_disconnect', '3', ['sd_bus_get_exit_on_disconnect'], ''], + ['sd_bus_set_fd', '3', [], ''], ['sd_bus_set_method_call_timeout', '3', ['sd_bus_get_method_call_timeout'], diff --git a/man/sd_bus_get_fd.xml b/man/sd_bus_get_fd.xml index 7297db316f0..2c0ec8fc055 100644 --- a/man/sd_bus_get_fd.xml +++ b/man/sd_bus_get_fd.xml @@ -22,7 +22,6 @@ sd_bus_get_fd - sd_bus_set_fd sd_bus_get_events sd_bus_get_timeout @@ -39,13 +38,6 @@ 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 @@ -69,11 +61,6 @@ object was configured with the 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, POLLOUT, … events, or negative on error. @@ -122,9 +109,6 @@ 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. - 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. @@ -164,13 +148,6 @@ return. - - -EBADF - - An invalid file descriptor was passed to - sd_bus_set_fd(). - - -ENOPKG @@ -191,6 +168,7 @@ sd_bus_process3, sd_bus_attach_event3, sd_bus_wait3, + sd_bus_set_fd3, poll3 diff --git a/man/sd_bus_set_fd.xml b/man/sd_bus_set_fd.xml new file mode 100644 index 00000000000..3860ab06cd2 --- /dev/null +++ b/man/sd_bus_set_fd.xml @@ -0,0 +1,120 @@ + + + + + + + + + sd_bus_set_fd + systemd + + + + sd_bus_set_fd + 3 + + + + sd_bus_set_fd + + Set the file descriptors to use for bus communication + + + + + #include <systemd/sd-bus.h> + + + int sd_bus_set_fd + sd_bus *bus + int input_fd + int output_fd + + + + + + Description + + sd_bus_set_fd() sets the file descriptors used to communicate by a bus + connection object. Both input_fd and output_fd must be + valid file descriptors, referring to stream-based file objects (e.g. a stream socket, a pair of pipes or + FIFOs, or a even a TTY device). input_fd must be readable, and + output_fd must be writable. The same file descriptor may be used (and typically is + used) as both the input and the output file descriptor. This function must be called before the bus + connection is started via + sd_bus_start3. + + The bus connection object will take possession of the passed file descriptors and will close them + automatically when it is freed. Use + sd_bus_set_close_on_exit3 + to turn off this behaviour. + + + + Return Value + + On success, sd_bus_set_fd() returns a non-negative integer. On + failure, it returns a negative errno-style error code. + + + Errors + + Returned errors may indicate the following problems: + + + + -EINVAL + + An invalid bus object was passed. + + + + -ECHILD + + The bus connection was allocated in a parent process and is being reused + in a child process after fork(). + + + + -EBADF + + An invalid file descriptor was passed to + sd_bus_set_fd(). + + + + -ENOPKG + + The bus cannot be resolved. + + + + -EPERM + + The bus connection has aleady been started. + + + + + + + + + See Also + + + systemd1, + sd-bus3, + sd_bus_get_fd3, + sd_bus_start3 + + + +