previous: >>107813965#define __NR_poll 7so early on, and we're already breaking into async operations. poll is quite exciting! it makes use of signals, timespecs, and structs with varying definitions. it's a good example of how linux had modernized over the yearsrelevant 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_poll 7
man man
man syscalls
>>107824139poll is a relict of the past just use epollalso why poll is faster than select why did they make select when poll was already in?
why file descriptors are blocking by default?say i have a pipe fd that poll (or select (or epoll)) lets me know that this pipe is readablehow am i supposed to know that I read everything off the pipe without making that file descriptor non-blocking?also most tutorials dont even tell you can just make fds nonblockig, took me a while to realize that
>>107824365faster as in it has smaller syscall number not in performance
>>107824392read documentation, faggot
>>107824139at least he's happy serving his master
https://linux.die.net/man/2/poll
>>107824392>>107824405(nta)process sleeps until it gets input?
>>107824434read documentation
>>107824438i will do unspeakable things to your computerand im gonna make you watch it all
>>107824457you can't even read
poll is retarded. You can only wait for events on file descriptors. A truly useful poll would also allow you to wait on process or thread termination. Also, they still haven't deprecated select so half of codemonkeys still use it despite that it's even far worse than poll.
>>107824464yes i can but you could have said"uh-huh"
>>107824468pidfd exists, midwit
>>107824468>process terminationpidfd>thread therminationeventfdyou can pretty much do anything and wait for anything you want with eventfdthere is also signalfd so you can get SIGINT in a poll instead of the signal_handlers but i dont think it syscall wrapper in libc
>>107824468>poll is retardedgo back >>>/r/eddit
>>107824559>muh libcuse case?
>>107824365>epolllinux specific, not posix
>>107824473you clearly are illiterate
>>107824559>pidfdlinux specific>eventfdlinux specific
>>107824600or maybe disregard my post, this thread seems to be linux specific anyways
>>107824611Ye hope you will learn that writing cross platform programs is a lie and you're a buffoon for believing it.
>>107824592and?
>>107824627You're illiterate.
>>107824592yes i am, im self taughti came to this thread to prompt you for knowledge kekthat does sound liek the process is passed to the scheduler and sleeps until theres a change in the fd
>>107824624My program works on linux, freebsd, openbsd, macos and haiku so I guess its working fine. But how the fuck was macos "unix certified" or whatever and claim to be posix compatible when it didn't even support clock_gettime until relatively recently
>>107824629so?
>>107824636*though
>>107824650Why so mad bro? it works fine in my case because I dont have to deal with a billion file descriptors. I just need to know when a few are readable/writable.
>>107824659>>107824650but also I do get frequently people that ask me for support for other OS' in my other application that does some linux specific things (such as reading /proc)
>>107824659Because if I was an unironic memebsd user I'd want you to use kqueue instead of poll, just like as a Linux user I want you to use epoll or maybe io_uring, you stupid jeet.
>>107824476>>107824559Not POSIX.
>>107824810nobody cares, software that only restricts itself to poosix is jeetslop and you should kill yourself
>>107824810>posix only softwareuse case?
>>107824813>you should kill yourselfI won't.>>107824940Portability.
>>107824813be nice
#define __NR_lstat 6
>>107827400:)