gensio_alloc_channel(3)

πŸ’– gensio_alloc_channel β€” Library Functions Manual πŸ’–

okay bestie, so like... this one lives in section 3 of the manual, and it's literally called gensio_alloc_channel and it's about making a whole new channel. yes. a channel. on a gensio that can do channels. let's get into it 🫢


✨ NAME ✨

gensio_alloc_channel β€” bestie, it creates a brand new channel on a channel-capable gensio. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <gensio/gensio.h>

int gensio_alloc_channel(struct gensio *io, const char * const args[],
                    gensio_event cb, void *user_data,
                    struct gensio **new_io);

like look at that signature. she's serving. copy it exactly, no cap. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so gensio_alloc_channel creates a new channel on a channel-capable gensio. periodt. πŸ’«

and here's the thing β€” what "channel" even means here, and what args even means, is not a universal thing. it depends entirely on the particular gensio you're working with, so go check that particular gensio class over in gensio(5). iykyk. πŸ‘‘

🚨 not me dropping a lowkey important detail: the new gensio that gets created will be closed, and you must call gensio_open on it to actually start it up. it does NOT start itself. she's sitting there waiting for you to open her. do not forget. do not skip this. fr fr. 😭

πŸŽ€ RETURN VALUES πŸŽ€

  • Zero β€” returned on success. slay. βœ…
  • a gensio error β€” returned on failure. that's the failure vibe. πŸ’€

πŸ’œ SEE ALSO πŸ’œ

go read these too, bestie, they're part of the lore:


and that's the whole page, bestie πŸ’–βœ¨ this one was dated 27 Feb 2019 and it came out of the library functions manual, and honestly? iconic. main character energy from a function that just makes channels. go call gensio_open on your new gensio or it's giving nothing. πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from