This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PR-673


> I just checked Tuomas Heino's mail with fork_debug-0.3.  

Whazzat?

> He uses fflush (NULL) before calling fork and exit which shows the
> problem.

Then we have a bug (though there may have been changes from Uli and HJ in
the last few days that fixed it).

> Using _exit instead of exit fixes the problem.

That should be obvious, and if it didn't then it would not really be a
stdio problem.  That is, _exit just does a syscall to kill the process,
nothing else whatsoever (it damn well better not).

> But shouldn't it work with fflush also (according to your description)?

Yes.  POSIX requires that fflush'ing a stream before fork (and with no
intervening operations on the stream, obviously) make that stream and its
associated file descriptor be synched up so that the parent and child see
the same (correct) behavior.  By extension, fflush(NULL) must make all
streams safe.  (There are various other things that also must make a stream
safe, the conditions are complex.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]