Sponsor:

Your company here, and a link to your site. Click to find out more.

io_uring_prep_cmd - Man Page

prepare a command request for a socket

Synopsis

#include <liburing.h>

void io_uring_prep_cmd_sock(struct io_uring_sqe *sqe,
                            int cmd_op,
                            int fd,
                            int level,
                            int optname,
                            void *optval,
                            int optlen);

Description

The io_uring_prep_cmd_sock(3) function prepares an cmd request for a socket. The submission queue entry sqe is setup to use the socket file descriptor pointed to by fd to start an command operation defined by cmd_op.

This is a generic function, and each command has their own individual level, optname, optval values.  The optlen defines the size pointed by optval.

Available commands

SOCKET_URING_OP_SIOCINQ

Returns the amount of queued unread data in the receive buffer. The socket must not be in LISTEN state, otherwise an error -EINVAL is returned in the CQE res field. The following arguments are not used for this command level, optname, optval and optlen.

Negative return value means an error.

For more information about this command, please check unix(7).

SIOCOUTQ

Returns the amount of unsent data in the socket send queue. The socket must not be in LISTEN state, otherwise an error -EINVAL is returned in the CQE res. field. The following arguments are not used for this command level, optname, optval and optlen.

Negative return value means an error.

For more information about this command, please check unix(7).

Notes

The memory block pointed by optval needs to be valid/live until the CQE returns.

Return Value

Dependent on the command.

Errors

The CQE res field will contain the result of the operation.

See Also

io_uring_get_sqe(3), io_uring_submit(3), io_uring_register(2), unix(7)

Info

July 27, 2023 liburing-2.5 liburing Manual