sergensio_b_alloc.3(3)
β¨ sergensio_b_alloc β the blocking edition π
okay bestie, so this page is about the sergensio_b_alloc.3 family of functions from the Library Functions Manual β literally the whole blocking-control-for-serial-parameters-on-a-sergensio situation. buckle up π
πΈ 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>
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 π
so these are the glow-up versions of the non-blocking functions (the ones without the _b), except these ones block and wait for the results to come back. no "check back later", no "idk yet" β they wait. β³
β οΈ and listen, like all synchronous I/O, this comes with deadlock potential. deadlock is not cute. use these carefully, bestie, fr fr. π
to actually use these, you gotta first allocate a sergensio blocking data structure with sergensio_b_alloc so you can hand it to all the other functions. π«Ά
okay and this is important: that allocated value can only be used for one operation at a time. one. singular. no sharing. π and when you're done with it, you must free it with sergensio_b_free. don't leave it hanging, that's rude. π
with these functions, you pass a pointer to the value you want to set. here's the tea β β if the pointed-to value is zero, the value is not set, it's just fetched. and if the function returns without an error, the actual current value gets returned in the passed-in pointer's destination. so you always walk away knowing the real value. slay. β¨
also lowkey important: these do not require gensio_set_sync to work, and they may be intermixed with non-blocking operations. mix and match, it's giving flexible. π
for the details on the values and what they actually mean, go look at the various non-blocking functions β they've got the lore. π
π₯ RETURN VALUES π₯
0 on success, or a gensio error on failure. that's it, that's the vibe check. β
π 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)
(and yes, it really does say sergensio_iflowonctrol(3) up there β we don't fix typos in this house, we preserve them. π
iykyk.)
π AUTHOR π
Corey Minyard <minyard@acm.org> β the icon, the moment, the main character. π
and that's the whole page bestie!! this one's from way back on 20 Jul 2020, source/version sergensio_b_alloc.3(3), and honestly it ate. go forth and block responsibly. mwah πβ¨
π¦ where this page comes from
- alpine 3.22: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.23: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- alpine 3.24: gensio-doc 2.8.14-r0 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- debian bookworm: libgensio-dev 2.6.2-4 Β· GPL-2.0-only
- debian trixie: libgensio-dev 2.8.13-7 Β· GPL-2.0-only
- epel 9: libgensio-devel 2.8.15-1.el9 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 2.8.15-5.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: gensio-devel 2.8.2-bp160.1.13 Β· Apache-2.0 AND GPL-2.0-only AND LGPL-2.1-only
- ubuntu noble: libgensio-dev 2.8.2-6.1build1 Β· GPL-2.0-only
- ubuntu questing: libgensio-dev 2.8.13-7
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms