Supported capabilities

Functions that allow you to check for supported operations and capabilities.

struct io_uring_probe
struct io_uring_probe {
    __u8 last_op;   /* last opcode supported */
    __u8 ops_len;   /* length of ops[] array below */
    __u16 resv;
    __u32 resv2[3];
    struct io_uring_probe_op ops[0];
};

struct io_uring_probe_op
struct io_uring_probe_op {
__u8 op;
__u8 resv;
__u16 flags;        /* IO_URING_OP_* flags */
__u32 resv2;
};

https://img.shields.io/badge/linux%20kernel-5.6-green
struct io_uring_probe *io_uring_get_probe_ring(struct io_uring *ring)

Parameters

Return value: on success, a pointer to a io_uring_probe which is used to probe the capabilities of the io_uring subsystem of the running kernel. The io_uring_probe contains the list of supported operations. On failure, NULL is returned.

Note

This function allocates memory to hold the structure io_uring_probe. It is your responsibility to free it once you’re done.


https://img.shields.io/badge/linux%20kernel-5.6-green
struct io_uring_probe *io_uring_get_probe(void)

Returns a pointer to a io_uring_probe which is used to probe the capabilities of the io_uring subsystem of the running kernel. The io_uring_probe contains the list of supported operations.

This function is pretty much the same as io_uring_get_probe_ring(), except that there is no need for you to setup a ring or have a reference to one. It sets up a temporary ring so that it can fetch the details of supported operations for you. It then destroys the ring before it returns.

Note

This function allocates memory to hold the structure io_uring_probe. It is your responsibility to free it once you’re done.

See also

Example program to print supported io_uring operation in the running kernel.


https://img.shields.io/badge/linux%20kernel-5.6-green
int io_uring_opcode_supported(struct io_uring_probe *p, int op)

Function to determine of an io_uring operation is supported by your kernel. Returns 0 if the operation is not supported and a non-zero value if support is present. Take a look at supported operations example program to see this function in action.

Parameters

  • p: pointer to a io_uring_probe structure.

  • op: operation you want to check support for. One of the IO_URING_OP_* macros.

Return value: 0 if operation not supported, 1 otherwise.


https://img.shields.io/badge/linux%20kernel-5.6-green
int io_uring_register_probe(struct io_uring *ring, struct io_uring_probe *p, unsigned nr)

Low-level function that lets you get io_uring capabilities.

Parameters

  • ring: io_uring structure as set up by io_uring_queue_init().

  • p: pointer to io_uring_probe structure.

  • nr: number of structures in the array that p points to.

Return value: returns 0 on success and -errono on failure. You can use strerror(3) to get a human readable version of the reason for failure.