fork() + file descriptor bug in 1.7.27(0.271/5/3) 2013-12-09 11:54

Eric Blake eblake@redhat.com
Fri Jan 17 20:13:00 GMT 2014


On 01/15/2014 08:28 AM, tednolan@bellsouth.net wrote:

> Well, all I can say in this instance, is that arguably conforming to
> the bare letter of the standard (if that's in fact what is happening)
> is not "the right thing".  People certainly don't expect that stdio
> file pointers that exist at fork() time and which are never "used" by a
> child will be reset in the parent.  I mean, if they can't even be fclose()-ed
> to take them out of the picture, what chance have you got? -:)
> 
> FWIW, FreeBSD, Linux and Solaris all compile and run the test program
> with the behavoir I expect..

Rather, FreeBSD and Linux share the same behavior of having intuitive
action of not resetting the underlying fd position, but violating POSIX
in the process; while Solaris DOES reset the fd and would expose the
same undefined behavior in the sample program.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140117/a8531d0e/attachment.sig>


More information about the Cygwin mailing list