FSET(3)

NAME
fset_create, fset_destroy, fset_zero, fset_add, fset_del, fset_has - manipulation of a set of flow descriptors

SYNOPSIS
#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.

DESCRIPTION
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.

RETURN VALUE
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.

ERRORS
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.

ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
Interface | Attribute | Value
fset_create() | Thread safety | MT-Safe
fset_destroy() | Thread safety | MT-Safe
fset_zero() | Thread safety | MT-Safe
fset_add() | Thread safety | MT-Safe
fset_del() | Thread safety | MT-Safe
fset_has() | Thread safety | MT-Safe

SEE ALSO
fqueue(3), fevent(3)

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