[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: 1726050827963342.jpg (61 KB, 827x311)
61 KB
61 KB JPG
previous: >>107964764

#define __NR_select                23

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

select: like poll, but worse! on top of having such an absurdly unwieldy API, it doesn't even work for most file descriptors. i guess that's just a limitation of the glibc implementation, though, and not the underlying syscall. so maybe it's not quite so bad after all. the self pipe and usleep emulations are probably my favorite uses for this syscall. i love cool little hacks like that. what's your favorite hack in that genre? it doesn't have to be specifically related to select, but ideally it at least involves a syscall

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/
>>
bampu
>>
>>107974077
why did these retards made poll
and after that they made select?
>>
>>107974077
>like poll, but worse
eh. it's only "worse" because the bitmap is fixed size at comptime. poll's interface is shit too and you're better off just going straight to your platform's epoll-like abstraction or some spooky-memory-actions-at-a-distance shit like io_uring, IoUring or IOCP
>>
>>107974077
Is there any reason to use this instead of a more modern syscall for events?
>>
>>107978183
portability
epoll isn't avaiable outside linux
>>
>>107974077
loving sex with chise



[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.