[issue15896] Sporadic EINVAL in nonblocking pipe os.read when forked child fails on Mac OS

Vitaly report at bugs.python.org
Tue Sep 18 18:12:15 CEST 2012


Vitaly added the comment:

In the work-around, we need to watch out for what 'man 2 read' on Mac OS refers to as "normal file":

==
Upon successful completion, read(), readv(), and pread() return the number of bytes actually read and placed in the buffer.  *The system      guarantees to read the number of bytes requested if the descriptor references a normal file that has that many bytes left before the end-of-file*, but in no other case.
==

I am guessing that fstat() + S_ISREG() can be used to discern "normal files" from other types of file descriptors.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15896>
_______________________________________


More information about the Python-bugs-list mailing list