FQUEUE(3)

NAME
fqueue_create, fqueue_destroy, fqueue_next, fevent - I/O multiplexing on flows

SYNOPSIS
#include <ouroboros/fqueue.h> fqueue_t * fqueue_create(void); void fqueue_destroy(fqueue_t * fq); int fqueue_next(fqueue_t * fq); int fevent(fset_t * set, fqueue_t * fq, const struct timespec * timeo); Compile and link with -louroboros.

DESCRIPTION
The fqueue_create() function creates an fqueue_t structure which is an event queue that stores events that occured within a certain fset_t. The fqueue_destroy() function frees any resources associated with an fqueue_t fq. The fqueue_next() function retrieves the next event (a flow descriptor) that is ready within the event queue fq. The fevent() function retrieves all events that occured on any flow descriptor within set and returns them in the event queue fq. If a struct timespec * timeo can be provided, it will return either with new events or when timeo has expired. If timeo is NULL, the call will block indefinitely until an event occurs.

RETURN VALUE
On success, fqueue_create() returns a pointer to an fqueue_t. fqueue_destroy() has no return value. On success, fevent() returns the number of events that occured in set.

ERRORS
fqueue_create() returns NULL when insufficient resources were available to create the fqueue_t. fqueue_next() and fevent() can return -EINVAL An invalid argument was passed (fq or set was NULL). In addition, fqueue_next() can return -EPERM No more fds available in fq. and fevent() can return -ETIMEDOUT the interval set int timeo R expired before any event in set occured.

ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
Interface | Attribute | Value
fqueue_create() | Thread safety | MT-Safe
fqueue_destroy() | Thread safety | MT-Safe
fqueue_next() | Thread safety | MT-Safe
fevent() | Thread safety | MT-Safe

SEE ALSO
fset_create(3), fset_destroy(3), fset_add(3), fset_del(3), fset_has(3), fset_zero(3)

COLOPHON
This page is part of the Ouroboros project, found at https://bitbucket.org/ouroboros-rina/ouroboros