This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] abort: Only flush file-based stdio streams before termination
On Aug 21 2017, Florian Weimer <email@example.com> wrote:
>> _IO_cleanup must do locking as well, of course.
> That means that a process cannot terminate if flockfile on a stream has
> been called without a matching funlockfile. I don't think this is
> permitted by POSIX, and wouldn't be a desirable implementation, either.
Is it? That would simply be a programming error. Since POSIX requires
locking on stdio I don't see how it can require exit to use no locking.
> In a hypothetical, from-scratch stdio implementation, it should be
> possible to implement flush-once without locking, but it requires
> careful ordering of buffer pointer updates (or two locks instead of one).
I don't think making stdio lock-free is desirable.
Andreas Schwab, SUSE Labs, firstname.lastname@example.org
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."