Is there anything at all in Linux (or, in general, in POSIX OS) to ensure that no file descriptors will be reused during program execution, even if the file is closed and the other is open? I understand that this situation usually causes the file descriptor for the closed file to be reassigned to the newly opened file.
I am working on an I / O trace project, and it will make life easier if I can assume that after calling open () / fopen (), all subsequent I / O operations with this file descriptor refer to the same file.
I will take either compilation time or runtime.
If this is not possible, I can make my own accounting when I process the trace file (marking the location of all open and closed calls), but I would prefer to deflate the problem while the trace program is running.
source
share