File descriptor table for io_uring.
More...
#include <ring.hpp>
|
| int | init (size_t capacity) |
| | Initialize the file descriptor table with the given capacity.
|
| int | destroy () |
| | Destroy the file descriptor table.
|
| int | update (unsigned index_base, const int *fds, unsigned nr_fds) |
| | Update the file descriptor table starting from the given index.
|
| template<typename Func> |
| void | set_fd_accepter (Func &&accepter) |
| | Set the accepter function for incoming file descriptors.
|
| int | set_file_alloc_range (unsigned offset, unsigned size) |
| | Set the file allocation range for the fd table.
|
|
|
auto | async_fixed_fd_send (FdTable &dst, int source_fd, int target_fd, unsigned int flags) |
| | See io_uring_prep_msg_ring_fd.
|
File descriptor table for io_uring.
This class makes an abstraction over the io_uring file registration interface.
◆ destroy()
| int condy::FdTable::destroy |
( |
| ) |
|
|
inline |
Destroy the file descriptor table.
- Returns
- int Returns 0 on success or a negative error code on failure
◆ init()
| int condy::FdTable::init |
( |
size_t | capacity | ) |
|
|
inline |
Initialize the file descriptor table with the given capacity.
- Parameters
-
| capacity | The number of file descriptors to allocate in the table |
- Returns
- int Returns 0 on success or a negative error code on failure
◆ set_fd_accepter()
template<typename Func>
| void condy::FdTable::set_fd_accepter |
( |
Func && | accepter | ) |
|
|
inline |
Set the accepter function for incoming file descriptors.
User can use async_fixed_fd_send() to send a fixed fd to the fd table of another Runtime. This function sets the accepter function that will be called when such an operation is performed.
- Template Parameters
-
| Func | The type of the accepter function |
- Parameters
-
| accepter | The accepter function to set, which accepts an int32_t parameter representing the fixed file descriptor index being received. |
◆ set_file_alloc_range()
| int condy::FdTable::set_file_alloc_range |
( |
unsigned | offset, |
|
|
unsigned | size ) |
|
inline |
Set the file allocation range for the fd table.
- Parameters
-
| offset | The starting offset of the file allocation range |
| size | The size of the file allocation range |
- Returns
- int Returns 0 on success or a negative error code on failure
◆ update()
| int condy::FdTable::update |
( |
unsigned | index_base, |
|
|
const int * | fds, |
|
|
unsigned | nr_fds ) |
|
inline |
Update the file descriptor table starting from the given index.
- Parameters
-
| index_base | The starting index to update |
| fds | Pointer to the array of file descriptors |
| nr_fds | Number of file descriptors to update |
- Returns
- int Returns 0 on success or a negative error code on failure
The documentation for this class was generated from the following file: