On 09/26/2011 04:40 PM, Bruno Haible wrote:

On glibc systems (and probably many others as well), the invalid file
descriptor is already caught by fdopen(). But there is no guarantee that
all systems do this.

But this is gnulib. _We_ can make that guarantee for all systems, via the fdopen module, since systems that return a FILE* that cannot work will interfere with developers who assumed glibc semantics that fdopen() will properly fail. A first start would be to enhance the fdopen unit test to flush out any systems that do not have glibc semantics, to see if we have to even worry about the may fail aspect of the POSIX wording in the first place.

In fact, I may even open a POSIX bug to strengthen that into a shall fail, if we can't come up with a counterexample platform.

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Reply via email to