gensio_set_callback(3)
π gensio_set_callback(3) β Library Functions Manual π
okay bestie, welcome to the gensio callback page π this one lives in the Library Functions Manual, and it's short but it's important, so grab your strawberry drink π and let's get into it.
β¨ NAME β¨
gensio_set_callback, gensio_get_user_data, gensio_set_user_data β set the event callback and user data for a gensio
the way these three are literally the trio that makes your gensio actually talk back to you π«Ά
πΈ SYNOPSIS πΈ
#include <gensio/gensio.h>
void gensio_set_callback(struct gensio *io,
gensio_event cb, void *user_data)
void gensio_set_user_data(struct gensio *io, void *user_data);
void *gensio_get_user_data(struct gensio *io)
no cap, that's the whole vibe. three little functions. iconic.
π¦ DESCRIPTION π¦
gensio_set_callback β the main character π
gensio_set_callback sets the event handler and data for the gensio.
okay this is the part you CANNOT skip, fr fr. this must be done in theGENSIO_ACC_EVENT_NEW_CONNECTIONevent from agensio_accepterbefore any other operation is done on the gensio.
the only exception is that gensio_close may be called with callbacks not set. that's the one lil loophole π
you can call this function again if the gensio cannot generate any callbacks, generally after it has been closed. otherwise race conditions may occur. so like... don't be chaotic about it bestie π
gensio_set_user_data β the lowkey one π
gensio_set_user_data Just sets the user_data field in the gensio.
heads up: if this is called when the gensio is running, race conditions may occur. that's it, that's the warning. respect it π
gensio_get_user_data β the giving-back one π
gensio_get_user_data Return the user data passed in with the gensio was created or set by one of the above two functions.
so it hands you back whatever you stashed in there when you made the gensio, or whatever one of the two functions above put in there. cute, right? β¨
π SEE ALSO π
like obviously go read those too, iykyk π§
and that's the page, bestie!! this one's from the Library Functions Manual, it's the gensio_set_callback(3) page, dated 23 Feb 2019 β stay safe out there with your callbacks and your user_data, 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
- arch rolling: gensio 3.0.4-1 Β· GPL
- 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
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 43: libgensio-devel 3.0.4-1.fc43 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.2-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- fedora 44: libgensio-devel 3.0.4-1.fc44 Β· GPL-2.0-only AND LGPL-2.1-only AND Apache-2.0
- nixos 26.05: gensio 3.0.2
- nixpkgs unstable: gensio 3.0.2
- 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 jammy: libgensio-dev 2.3.5-1build2 Β· GPL-2.0-only
- ubuntu noble: libgensio-dev 2.8.2-6.1build1 Β· GPL-2.0-only
- ubuntu questing: libgensio-dev 2.8.13-7
- ubuntu resolute: libgensio-dev 3.0.0-1build1 Β· GPL-2.0-only
- ubuntu stonking: libgensio-dev 3.0.0-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms