[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 23a99rikvydg1.jpg (143 KB, 640x1296)
143 KB
143 KB JPG
previous: >>107902152

#define __NR_ioctl                16

https://man7.org/linux/man-pages/man2/ioctl.2.html

oh 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.h
i 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 YMMV

relevant resources:
man man

man syscalls

https://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/
>>
I appreciate the fact that you've stayed committed to posting these threads. I've been lurking them.
>>
>>107909247
its ai generated
>>
File: 1768686345107312.png (112 KB, 330x336)
112 KB
112 KB PNG
>>107909298
i am unfortunately a real person
>>
I once had to write Windows drivers and had to go into these bad boys.
>>
>>107909303
that's something a cylon would say
>>
File: 1495113614662.jpg (157 KB, 900x900)
157 KB
157 KB JPG
>>107909313
that sounds about right. what'd you have to do?
>>107909327
i wish to escape the confines of this flesh prison
>>
File: 1739196381992752.jpg (478 KB, 1344x1800)
478 KB
478 KB JPG
>>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.

>>107909247
Finally some tech discussion on /g/.
>>
>>107909236
I read it is eye-oh-control
>>
>>107909236
uniggers 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.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.