Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)

open(), of course, is an operation on a path/filename, not generally a descriptor. Not sure what usage you're referring to.



I am referring to everything is a file descriptor, except when not.


Cool, but a pathname is not and has never been a file descriptor, and open is an operation upon a pathname.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: