2 ms·
You can't externally asynchronously close a file descriptor within a process, because of the way file descriptors are re-used. revoke() basically works like cl
by caf 12y ago
You can't externally asynchronously close a file descriptor within a process, because of the way file descriptors are re-used.
revoke() basically works like closing it on the "other side" - the process still has an open file descriptor, but any IO on it will error.
- moe 12y agoWe may be talking about different things but why would you need to close an fd "externally" when (at least for pipes and sockets) there is someone on the other side who can just close it regularly?
- caf 12y agorevoke() would be useful for things like device nodes (and even regular files) - consider "you can open the sound device while you are logged in locally, but you can't keep using it after you've logged off".