FSET

Section: Ouroboros Programmer's Manual (3)
Updated: 2017-04-10
Index Return to wiki

 

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

 

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

 

TERMINOLOGY

Please see ouroboros-glossary(7).

 

SEE ALSO

fccntl(3), flow_alloc(3), flow_read(3), fccntl(3), fqueue(3), ouroboros(8)

 

COLOPHON

This page is part of the Ouroboros project, found at http://ouroboros.rocks

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/


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
ATTRIBUTES
TERMINOLOGY
SEE ALSO
COLOPHON

This document was created by man2html, using the manual pages.
Time: 07:31:45 GMT, August 02, 2024