Imagine this situation:
- one process (A) continuously writes data to disk by creating large files, to which it appends data using separate write() commands
- another process (B), continuously deletes files from disk
- the assumption is that (B) deletes data fast enough that (A) has room to write. However, it is not guaranteed.
- Imagine (A) attempts a write to an open descriptor and it gets ENOSPC. Since (A) knows that (B) should make some room, (A) would like to retry the write.
Question: is it safe for (A), after receiving ENOSPC, to attempt a write on the same descriptor it got ENOSPC on? I couldn't find any information about it, and I wonder if it might depend on things like OS, filesystem etc.