gensio_acc_control(3)

✨ gensio_acc_control β€” the girlies' guide to gensio accepter actions ✨

okay bestie, pull up a chair, we're doing gensio_acc_control(3) from the Library Functions Manual, and honestly? it's giving backstage pass to your accepter πŸ’…


πŸŽ€ NAME

gensio_acc_control β€” do gensio accepter specific actions. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS

#include <gensio/gensio.h>

int gensio_acc_control(struct gensio_accepter *acc, int depth,
                    bool get, unsigned int option,
                    char *data, gensiods *datalen);

πŸ’– DESCRIPTION

gensio_acc_control performs a gensio accepter specific operation on the gensio accepter. no cap. it works exactly like gensio_control(3), so if you need the tea on get, depth, and how data and datalen do their little dance, go read that one β€” this function is literally just that, but for accepters πŸ‘‘

the gensio control operations in option depend on the particular gensio. some of them are documented down below, but bestie, there may be other controls available that aren't listed here. check the gensio documentation in gensio(5) for the full scoop ✨

πŸ”₯ GENSIO_ACC_CONTROL_LADDR

returns the given local address for the given gensio. and here's the thing β€” a single gensio can have more than one local address, so this control is how you tell it which one you're asking about πŸ’…

the data string you pass in should be the string representation of a number (like the kind you'd create with snprintf()) for the particular index you want to fetch. if you specify a number larger than the number of open listen sockets, you get GE_NOTFOUND back. rude, but fair 😭

the return data is a string holding the address.

heads up: a single fetched string may contain more than one address, and those get separated by semicolons. in some cases addresses may change dynamically (like with SCTP), so you get a single set of addresses. slay, but keep up 🧚

πŸ¦‹ GENSIO_ACC_CONTROL_LPORT

returns the port for the given local address for the given gensio. same situation as above β€” one gensio, possibly many local addresses, so this control tells you which one you mean ✨

the data string passed in should be the string representation of a number (like created with snprintf()) for the particular index you want to fetch. and again: specify a number larger than the number of open listen sockets and GE_NOTFOUND is what you get. no cap. πŸ’€

the return data is a string holding the port number.

πŸ“ GENSIO_ACC_CONTROL_TCPDNAME

get or set the TCPD name for the gensio. only for TCP gensios, bestie β€” don't try it anywhere else πŸ™ˆ


⭐ RETURN VALUES

zero is returned on success, or a gensio error on failure. that's the whole vibe check: 0 = iconic, anything else = we have a problem πŸ’–


🌈 SEE ALSO

go read them, iykyk 🫢


and that's the whole page, bestie! this little love letter to accepters is brought to you by the Library Functions Manual, dated 27 Feb 2019 β€” gensio_acc_control(3), periodt πŸ’…βœ¨

πŸ“¦ where this page comes from