gensio_acc_accept_s(3)
π gensio_acc_accept_s β the synchronous accepter glow-up π
okay bestie, so this is one of the Library Functions Manual pages, and it's all about doing accepter stuff synchronously instead of the usual callback chaos. no cap, it's short but it's important, so let's get into it π«Ά
β¨ NAME β¨
gensio_acc_set_sync, gensio_acc_accept_s, gensio_acc_accept_s_intr β the trio that does Synchronous I/O operations on a gensio accepter π
πΈ SYNOPSIS πΈ
#include <gensio/gensio.h>
int gensio_acc_set_sync(struct gensio_accepter *acc);
int gensio_acc_accept_s(struct gensio_accepter *acc,
struct gensio_time *timeout,
struct gensio **new_io);
int gensio_acc_accept_s_intr(struct gensio_accepter *acc,
struct gensio_time *timeout,
struct gensio **new_io);
like yes, that's the whole vibe up there β
π¦ DESCRIPTION π¦
so normally, a gensio accepter is asynchronous callback based. and honestly? that serves most programs very well, especially the ones that need to juggle multiple accepts on the same accepter or on different accepters. main character energy, truly π
but every once in a while you need to do something synchronous with the program execution. lowkey the most common case is when you've got a simple little program that just accepts one connection and then does a thing. no callbacks, no drama, just vibes.
gensio_acc_set_sync β flip the switch π₯
gensio_acc_set_sync sets up the gensio accepter for synchronous accepts.
and here's the part you need to hear, bestie:
- once you do this, the event callback that is currently registered will no longer receive new connection events.
- it *will* still receive other callbacks though. so don't ghost it entirely π
- you must call this before starting up the gensio accepter.
- and once you call it, the gensio accepter is in sync mode until you shut it down. no take-backsies, periodt.
gensio_acc_accept_s β the waiting game π
gensio_acc_accept_s waits for an incoming connection on the gensio accepter.
- it waits for the amount of time in
timeout timeoutgets updated to the amount of time left to wait- if
timeoutisNULL, it waits forever π (yes, forever forever) - if no error is returned, the new incoming connection comes back to you in
new_ioπ
gensio_acc_accept_s_intr β the interruptible twin π§
gensio_acc_accept_s_intr is like gensio_acc_accept_s, but it returns immediately if a signal interrupt occurs.
on systems without signals, this is the same as gensio_acc_accept_s. iykyk.
π RETURN VALUES π
- Zero is returned on success π
- or a gensio error on failure π
that's it. that's the whole return value situation.
π SEE ALSO π
go read those too, bestie, they're part of the lore π
and that's the page!! this lil gem is from the gensio_acc_accept_s(3) manual, source/version vibes dated 27 Jan 2020 β iconic, historic, a moment in time π
β¨ slay, go accept some connections fr fr π¦
π¦ 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 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