Sponsor:

Your company here, and a link to your site. Click to find out more.

sergensio_b_alloc - Man Page

Blocking control for serial parameters on a sergensio

Synopsis

#include <gensio/sergensio.h>

int sergensio_b_alloc(struct sergensio *sio, struct gensio_os_funcs *o,

struct sergensio_b **new_sbio);

void sergensio_b_free(struct sergensio_b *sbio);
int sergensio_baud_b(struct sergensio_b *sbio, unsigned int *baud);
int sergensio_datasize_b(struct sergensio_b *sbio,

unsigned int *datasize);

int sergensio_parity_b(struct sergensio_b *sbio, unsigned int *parity);
int sergensio_stopbits_b(struct sergensio_b *sbio,

unsigned int *stopbits);

int sergensio_flowcontrol_b(struct sergensio_b *sbio,

unsigned int *flowcontrol);

int sergensio_iflowcontrol_b(struct sergensio_b *sbio,

unsigned int *iflowcontrol);

int sergensio_sbreak_b(struct sergensio_b *sbio, unsigned int *breakv);

int sergensio_dtr_b(struct sergensio_b *sbio, unsigned int *dtr);

int sergensio_rts_b(struct sergensio_b *sbio, unsigned int *rts);

int sergensio_cts_b(struct sergensio_b *sbio, unsigned int *cts);

int sergensio_dcd_dsr_b(struct sergensio_b *sbio, unsigned int *dcd_dsr);

int sergensio_ri_b(struct sergensio_b *sbio, unsigned int *ri);

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>

Referenced By

sergensio(5), sergensio_baud(3).

The man pages sergensio_baud_b(3), sergensio_b_free(3), sergensio_cts_b(3), sergensio_datasize_b(3), sergensio_dcd_dsr_b(3), sergensio_dtr_b(3), sergensio_flowcontrol_b(3), sergensio_iflowcontrol_b(3), sergensio_parity_b(3), sergensio_ri_b(3), sergensio_rts_b(3), sergensio_sbreak_b(3) and sergensio_stopbits_b(3) are aliases of sergensio_b_alloc(3).

20 Jul 2020