3 ms·
You can't lseek() (what is seek()?) a socket because lseek doesn't make sense on 'streaming' data. There are multiple answers for how it can be done (i.e. recei
by jfrunyon 6y ago
You can't lseek() (what is seek()?) a socket because lseek doesn't make sense on 'streaming' data. There are multiple answers for how it can be done (i.e. receive it to a buffer) but you can do that yourself, in userspace, at no real expense. You also can't lseek a pipe, or files on some types of hardware, and "POSIX does not specify which devices must support lseek()" (https://man7.org/linux/man-pages/man2/lseek.2.html https://man7.org/linux/man-pages/man2/lseek.2.html)
open(), of course, is an operation on a path/filename, not generally a descriptor. Not sure what usage you're referring to.