vendredi 27 février 2015

What is the persistence of the handle of a broken FIFO?


Say an application opens for writing, a file, which is a FIFO to which something is “listening”, and later, this “listener” closes; if the application attempts to write to it, the application will get a broken pipe error. That's OK, but I wonder if there is a risk for the handle to be reused and therefore a risk for writing to an handle which is not anymore what's supposed to be. Thus the question: what's the persistence of the handle of a broken FIFO? How long can an application rely on the broken pipe error, to know the other end of the FIFO was closed? Or is it guaranteed the handle will never be reused for all the lifetime of the application unless it has explicitly closed it?



Aucun commentaire:

Enregistrer un commentaire