#./fio-stl/102 poll api.h
16 public symbols.
#Macros
#FIO_POLL_POSSIBLE_FLAGS
#define FIO_POLL_POSSIBLE_FLAGS (POLLIN | POLLOUT | POLLPRI)The user flags IO events recognize
Symbol type: macro
#FIO_POLL_MAX_EVENTS
#define FIO_POLL_MAX_EVENTS 256relevant only for epoll and kqueue - maximum number of events per review
Symbol type: macro
#FIO_POLL_ENGINE_EPOLL
#define FIO_POLL_ENGINE_EPOLLSymbol type: macro
#FIO_POLL_ENGINE_KQUEUE
#define FIO_POLL_ENGINE_KQUEUESymbol type: macro
#FIO_POLL_ENGINE_POLL
#define FIO_POLL_ENGINE_POLLSymbol type: macro
#FIO_POLL_ENGINE_STR
#define FIO_POLL_ENGINE_STR "epoll"Symbol type: macro
#FIO_POLL_VALIDATE
#define FIO_POLL_VALIDATE(settings_dest) \
if (!(settings_dest).on_data) \
(settings_dest).on_data = fio___poll_ev_mock; \
if (!(settings_dest).on_ready) \
(settings_dest).on_ready = fio___poll_ev_mock; \
if (!(settings_dest).on_close) \
(settings_dest).on_close = fio___poll_ev_mock;Symbol type: macro
#Types
#fio_poll_s
struct fio_poll_sthe fio_poll_s type should be considered opaque.
Symbol type: type
#fio_poll_settings_s
typedef struct {
/** callback for when data is available in the incoming buffer. */
void (*on_data)(void *udata);
/** callback for when the outgoing buffer allows a call to `write`. */
void (*on_ready)(void *udata);
/** callback for closed connections and / or connections with errors. */
void (*on_close)(void *udata);
} fio_poll_settings_sSymbol type: type
#Functions
#fio_poll_init
inline void fio_poll_init(fio_poll_s *p, fio_poll_settings_s)Initializes the polling object, allocating its resources.
Symbol type: function
#fio_poll_init
#define fio_poll_init(p, ...) \
fio_poll_init((p), (fio_poll_settings_s){__VA_ARGS__})Initializes the polling object, allocating its resources.
Note: this may be a macro only / macro wrapper for a function.
Symbol type: macro
#fio_poll_destroy
inline void fio_poll_destroy(fio_poll_s *p)Destroys the polling object, freeing its resources.
Symbol type: function
#fio_poll_engine
inline const char *fio_poll_engine(void)returns the system call used for polling as a constant string.
Symbol type: function
#fio_poll_monitor
int fio_poll_monitor(fio_poll_s *p, fio_socket_i fd, void *udata, unsigned short flags)Adds a file descriptor to be monitored, adds events to be monitored or
updates the monitored file's udata.
Possible flags are: POLLIN and POLLOUT. Other flags may be set but might
be ignored.
Monitoring mode is always one-shot. If an event if fired, it is removed from the monitoring state.
Returns -1 on error.
Symbol type: function
#fio_poll_review
int fio_poll_review(fio_poll_s *p, size_t timeout)Reviews if any of the monitored file descriptors has any events.
timeout is in milliseconds.
Returns the number of events called.
Polling is thread safe, but has different effects on different threads.
Adding a new file descriptor from one thread while polling in a different
thread will not poll that IO until fio_poll_review is called again.
Symbol type: function
#fio_poll_forget
int fio_poll_forget(fio_poll_s *p, fio_socket_i fd)Stops monitoring the specified file descriptor (if monitoring).
Symbol type: function