跳转到主要内容

sd_varlink_push_fd

systemd

3

Submit a file descriptor to send along with the next outgoing Varlink message

#include <systemd/sd-varlink.h>

int

int

fd

int

int

fd

Description

Note that file descriptor passing is only permitted after a call to sd_varlink_set_allow_fd_passing_output() that enables it, otherwise these calls will fail with -EPERM.

Note that on Linux a maximum of 253 file descriptors may be enqueued on AF_UNIX sockets at once. Attempting to enqueue more on a single Varlink message will fail with -ENOBUFS.

Return Value

On success, sd_varlink_push_fd() and sd_varlink_push_dup_fd() return a non-negative integer. On failure, they return a negative errno-style error code.

Errors

Returned errors may indicate the following problems:

-EINVAL
An argument is invalid.

-EBADF
The provided file descriptor is not valid.

-EPERM
File descriptor passing has not been enabled via sd_varlink_set_allow_fd_passing_output().

-ENOBUFS
The maximum of 253 file descriptors have already been submitted for the next outgoing Varlink message, no further descriptors may be enqueued for this message.

-ENOMEM
Memory allocation failed.

History

See Also

systemd(1), sd-varlink(3)