previous: >>107902152#define __NR_ioctl 16https://man7.org/linux/man-pages/man2/ioctl.2.htmloh boy, today is really something. this is probably one of the top 5 most complicated syscalls out there. the manpage itself describes the call as "a catch-all for operations that don't cleanly fit the UNIX stream I/O model". not to mention how it's completely implementation defined.>Usually, on success zero is returned.always a good sign when your API "usually" behaves a certain way lmao.this is the type of syscall where you're honestly best off just reading the kernel source for whatever device you're working with. i really don't even have much to say beyond this, since so much of what there is to discuss about ioctl varies by device. i guess the only other thing i will do is link this header: https://elixir.bootlin.com/linux/v6.18.6/source/include/uapi/asm-generic/ioctl.hi encourage everyone who has had experience working with ioctl to please post their use case, though. hopefully we can get a pretty large breadth of devices and give a realistic view on how the syscall might be used! bonus discussion: how do you pronounce ioctl? this developer typically goes with "eye-octal", but YMMVrelevant resources: man manman syscallshttps://man7.org/linux/man-pages/https://linux.die.net/man/https://elixir.bootlin.com/linux/https://elixir.bootlin.com/musl/https://elixir.bootlin.com/glibc/
#define __NR_ioctl 16
man man
man syscalls
I appreciate the fact that you've stayed committed to posting these threads. I've been lurking them.
>>107909247its ai generated
>>107909298i am unfortunately a real person
I once had to write Windows drivers and had to go into these bad boys.
>>107909303that's something a cylon would say
>>107909313that sounds about right. what'd you have to do?>>107909327i wish to escape the confines of this flesh prison
>>107909236>i encourage everyone who has had experience working with ioctl to please post their use case, though.Like you said, if you want the deep-dive it's really driver dependent, and I think most use cases would be "how do I do this with my device?" with IOCTL being a means to an end. I pronounce it IO Control but I almost never say it aloud.>>107909247Finally some tech discussion on /g/.
>>107909236I read it is eye-oh-control
>>107909236uniggers will do anything but call it message passing. it seems to be to basically be a more atomic, api-friendly way to update kernel state when echo x >/sys/* causes problems. I would've rather had a better api to write into and read from sysfs style files; it's probably an idea many have had too.