Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jun 2021 19:43:47 -0400
From:      Paul Procacci <pprocacci@gmail.com>
To:        "Ronald F. Guilmette" <rfg@tristatelogic.com>
Cc:        freeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Is a successful call to write(2) atomic?
Message-ID:  <CAFbbPugCir436Z6cHyOZBtRAQ0on0eFfYc0Z0xNrhHCRW3r=4A@mail.gmail.com>
In-Reply-To: <25766.1623793238@segfault.tristatelogic.com>
References:  <CADqw_gKYTV-tRKxPFD1q78_gnpR2DWwmkTxLZJFmo4CUGqGqsg@mail.gmail.com> <25766.1623793238@segfault.tristatelogic.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> I frankly don't know.  It seems highly likely to me that Posix is most
> probably very precise in defining the behavior, but one would have to
> wade through a hundred pages or so to find the exact and crisp answer.--
>
>
I read some of them last night before responding to you to ensure all my
ducks were in a row.  ;)

https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_05_01
https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_07
https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html

The last link in particular ... used to read as:

"This volume of POSIX.1-2008 does not specify behavior of concurrent writes
to a file from multiple processes. Applications should use some form of
concurrency control. "

It now reads:

This volume of POSIX.1-2017 does not specify the behavior of concurrent
writes to a regular file from multiple threads, except that each write is
atomic (see *Thread Interactions with Regular File Operations*
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_07>).
Applications should use some form of concurrency control.

In both cases, it states:  "Applications should use some form of
concurrency control".

~Paul

__________________

:(){ :|:& };:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFbbPugCir436Z6cHyOZBtRAQ0on0eFfYc0Z0xNrhHCRW3r=4A>