Scroll to navigation

sergensio_b_alloc.3(3) Library Functions Manual sergensio_b_alloc.3(3)

NAME

sergensio_b_alloc, sergensio_b_free, sergensio_baud_b, sergensio_datasize_b, sergensio_parity_b, sergensio_stopbits_b, sergensio_flowcontrol_b, sergensio_iflowcontrol_b, sergensio_sbreak_b, sergensio_dtr_b, sergensio_rts_b - Blocking control for serial parameters on a sergensio

SYNOPSIS

#include <gensio/sergensio.h>


struct sergensio_b **new_sbio);

unsigned int *datasize);

unsigned int *stopbits);

unsigned int *flowcontrol);

unsigned int *iflowcontrol);

DESCRIPTION

These are equivalent to the non-blocking functions (without the _b), but block waiting for the results. Like all synchronous I/O, this can come with deadlock potential, so these should be used carefully.

To use these, you must first allocate a sergensio blocking data structure using sergensio_b_alloc for use in the other functions. This allocated value can only be used for one operation at a time. When you are done with it, you must free it with sergensio_b_free.

With these function, you pass a pointer to the value you want to set. If the pointed to value is zero, the value is not set, just fetched. If the function returns without an error, the actual current value is returned in the passed-in pointer's destination.

Note that these do not require gensio_set_sync to work, and may be intermixed with non-blocking operations.

See the various non-blocking functions for detail on the values and what they mean.

RETURN VALUES

Zero is returned on success, or a gensio error on failure.

SEE ALSO

sergensio(5), sergensio_baud(3), sergensio_datasize(3), sergensio_parity(3), sergensio_stopbits(3), sergensio_flowcontrol(3), sergensio_iflowonctrol(3), sergensio_sbreak(3), sergensio_dtr(3), sergensio_rts(3)

AUTHOR

Corey Minyard <minyard@acm.org>

20 Jul 2020