Re: [PATCH] mingw: enable atomic O_APPEND
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 13, 2018, 21:55 UTC
- Message-ID
- <xmqqo9e62aos.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <87eff2rmgt.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> O_APPEND in POSIX is race-free only up to PIPE_MAX bytes written at a > time, which is e.g. 2^12 by default on linux, after that all bets are > off and the kernel is free to interleave different write calls.
We are only interested in the use of race-safe append in the tracing, so we should be OK in practice. but then ...
> So there's still a use for a race_safe_append_open() wrapper function, > to O_APPEND and do the PIPE_MAX assertion. Otherwise you're calling a > "safe" function which isn't safe at all anymore.
... having an assert that would never trigger is not all that bad ;-)