fset_create, fset_destroy, fset_zero, fset_add, fset_del, fset_has - manipulation of a set of flow descriptors
#include <ouroboros/fqueue.h>
fset_t * fset_create(void);
void fset_destroy(fset_t * set);
void fset_zero(fset_t * set);
int fset_add(fset_t * set, int fd);
int fset_del(fset_t * set, int fd);
bool fset_has(fset_t * set, int fd);
Compile and link with -louroboros-dev.
These calls are used to manage a set of flow descriptors.
The fset_create() function creates and fset_t struct which holds a set of flow descriptors.
The fset_destroy() function frees any resources associated with an fset_t set.
The set_zero() function removes all flow descriptors from an fset_t set.
The set_add() function adds a flow descriptor fd to the fset_t set. A flow descriptor can be in at most one fset at a time.
The fset_del() function removes a flow descriptor fd from the fset_t set. fset_del() ignores invalid input.
The fset_has() function checks whether a flow descriptor fd is an element of the fset_t set.
On success, fset_create() returns a pointer to an fset_t.
fset_destroy(), set_zero() and fset_del() have no return value.
fset_add() returns 0 on success or an error code.
fset_has() returns true when fd is in the set, false if it is not or on invalid input.
fset_create() returns NULL when insufficient resources were available to create the fset_t.
fset_add() can return the following errors:
-EINVAL An invalid argument was passed (set was NULL or fd was invalid).
-EPERM The passed flow descriptor fd was already in another fset_t.
For an explanation of the terms used in this section, see attributes(7).
|
fccntl(3), flow_alloc(3), flow_read(3), fccntl(3), fqueue(3), ouroboros(8)
These man pages are licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/