|
|
Log in / Subscribe / Register

ioctl() forever?

ioctl() forever?

Posted Jun 9, 2022 11:02 UTC (Thu) by jengelh (subscriber, #33263)
Parent article: ioctl() forever?

>that netlink could not be used because it depends on networking being configured into the kernel

Perhaps when someone ponders its use for a component, what they really had in mind was just the serialization format, without the AF_NETLINK socket. You could still hand in a netlink-formatted stream via ioctl.

Netlink has its own share of issues. One is the asynchronous model and the programming that this entails; you need to do two at least two calls (send/recv). Another is the 16-bit size fields in its serialization format. If you can't fit your stuff into one message because of that limit, you have to go on a multi-roundtrip endeavour from userspace. The kernel part meanwhile may need to keep extra state to logically tie the individual netlink messages together. That's kinda terrible.

Speaking of ioctl, setsockopt is just the same.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds