2 ms·
The author is talking about a cross-platform interface standardised by POSIX, it's not really the same thing as the details of one particular implementation. It
by usrnm 3y ago
The author is talking about a cross-platform interface standardised by POSIX, it's not really the same thing as the details of one particular implementation. It isn't about how, but why
- epcoa 3y agoThe gp isn’t only talking about a particular implementation. The concept and terminology of an “open file description” (represented by a struct file in Linux and BSD and others) in contrast to a “file descriptor” are standardized/documented in POSIX.
- pjmlp 3y agoThis is part of POSIX. => The dup() function provides an alternative interface to the service provided by fcntl() using the F_DUPFD command. The call dup(fildes) shall be equivalent to: => fcntl(fildes, F_DUPFD, 0); -- https://pubs.opengroup.org/onlinepubs/9699919799/ https://pubs.opengroup.org/onlinepubs/9699919799/ Going to fcntl() docs, => The new file descriptor shall refer to the same open file description as the original file descriptor, and shall share any locks -- https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/f... Which implies being exactly the same kernel data structure for the file description, with all its current state.