gensio_open(3)

πŸ“¦
version 3.0.4 Β· 2 versions
  • 3.0.4 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.3.5 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– gensio_open(3) β€” the "start a connecting gensio" era ✨

okay bestie, so this is gensio_open(3) from the Library Functions Manual, and it's literally the page about starting a connecting gensio. four whole functions, one job, and honestly? she ate. πŸŽ€


🌸 NAME 🌸

gensio_open, gensio_open_s, gensio_open_nochild, gensio_open_nochild_s β€” start a connecting gensio. that's it, that's the whole vibe. periodt. πŸ’…


✨ SYNOPSIS ✨

first you gotta pull in the header, no skips:

#include <gensio/gensio.h>

then the callback type, which is giving very "we'll call you back, promise" energy:

typedef void (*gensio_done_err)(struct gensio *io, int err,
                    void *open_data);

and then the four icons themselves:

int gensio_open(struct gensio *io, gensio_done_err open_done,
                    void *open_data);

int gensio_open_s(struct gensio *io);

int gensio_open_nochild(struct gensio *io, gensio_done_err open_done,
                    void *open_data);

int gensio_open_nochild_s(struct gensio *io);

πŸ¦‹ DESCRIPTION πŸ¦‹

gensio_open starts the gensio. that's the whole main character move. now here's the lore: gensios you got from an accepter are already open the second you receive them, but connecting gensios start out closed and need to be opened before you can actually use them. rude? maybe. true? yes.

if no error comes back, the open_done callback gets called β€” and if err inside that callback is also no error, then congrats bestie, the gensio is open. and heads up, this opens all children, too. the whole fam. πŸ’–

IMPORTANT GIRLIES: the open_done callback is always called. like, always. even if you close the gensio before the open_done callback happens, even if an error occurs. this is guaranteed. no cap. πŸ”₯

gensio_open_s is like gensio_open but she waits for the open to complete. normal gensio processing still happens while you're waiting, so nothing stalls out. BUT β€” be careful, okay? you must not call this from a callback. only call it from a non-callback thread or a runner. (see gensio_os_funcs(3) for the details on runners. iykyk. 🧚)

gensio_open_nochild is like gensio_open, except it assumes any child gensios are already open and just opens this one gensio. super useful when you've got a gensio that's already opened β€” like, say, one you received from an accepter β€” and you wanna stack another gensio on top of it. the catch? only filter gensios support this. everyone else said no. πŸ’€

gensio_open_nochild_s is like gensio_open_nochild but she waits for the open to complete too. same warnings as gensio_open_s up above β€” go read them again, bestie, i'm serious. πŸ™ˆ


⭐ RETURN VALUES ⭐

  • 0 β€” returned on success. slay.
  • a gensio error β€” returned on failure. not slay, but at least you know.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie πŸ’œ that was gensio_open(3) from the Library Functions Manual, dated 27 Feb 2019 β€” yeah she's an elder but she still serves. go forth and open your gensios responsibly. mwah. πŸ«ΆπŸŽ€βœ¨

πŸ“¦ where this page comes from