Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
Loading...
Searching...
No Matches
srn_reactor_io_completion_t Struct Reference

A completion, the result of one submission, echoed back on the channel. More...

#include <reactor.h>

Data Fields

 ERROR_HEADER
void * fiber_data
 The fiber_data of the submission this completes.
size_t result
 The result of the operation on success, bytes transferred for the transfers, the accepted descriptor for SRN_REACTOR_IO_ACCEPT, 0 for SRN_REACTOR_IO_CONNECT and SRN_REACTOR_IO_NOP.
uint32_t addrlen
 For SRN_REACTOR_IO_ACCEPT and SRN_REACTOR_IO_RECVFROM, the actual length of the address written into the request's addr (the kernel's value-result addrlen), which lets a caller interpret a variable or mixed-family address (IPv6, Unix-domain, a dual-stack listener).

Detailed Description

A completion, the result of one submission, echoed back on the channel.

It is a fallible value (see errors.h). maybe_error is null on success and points at the failure otherwise, so result/addrlen are meaningful only when there is no error. The backend sets maybe_error from a static IO error to avoid unnecessary memory allocation.

Definition at line 156 of file reactor.h.

Field Documentation

◆ addrlen

uint32_t srn_reactor_io_completion_t::addrlen

For SRN_REACTOR_IO_ACCEPT and SRN_REACTOR_IO_RECVFROM, the actual length of the address written into the request's addr (the kernel's value-result addrlen), which lets a caller interpret a variable or mixed-family address (IPv6, Unix-domain, a dual-stack listener).

The consumer knows its op, so it reads this only for those two; unused otherwise.

Definition at line 169 of file reactor.h.

◆ ERROR_HEADER

srn_reactor_io_completion_t::ERROR_HEADER

Definition at line 157 of file reactor.h.

◆ fiber_data

void* srn_reactor_io_completion_t::fiber_data

The fiber_data of the submission this completes.

Definition at line 159 of file reactor.h.

◆ result

size_t srn_reactor_io_completion_t::result

The result of the operation on success, bytes transferred for the transfers, the accepted descriptor for SRN_REACTOR_IO_ACCEPT, 0 for SRN_REACTOR_IO_CONNECT and SRN_REACTOR_IO_NOP.

Unspecified when maybe_error is set.

Definition at line 163 of file reactor.h.


The documentation for this struct was generated from the following file: