read(2) and thus bsdiff is limited to 2^31 bytes

Peter Jeremy peter at rulingia.com
Tue May 24 06:57:27 UTC 2016


On 2016-May-23 15:41:06 +0200, Joerg Sonnenberger <joerg at bec.de> wrote:
>On Mon, May 23, 2016 at 02:31:18PM +0200, Cedric Blancher wrote:
>> Nothing in POSIX mandates that read()/write() are atomic. Old UNIX,
>> SystemV, AIX, Solaris and HP-UX don't do that nor do they guarantee
>> that.
>
>"I/O is intended to be atomic to ordinary files and pipes and FIFOs."

To expand that a little, the rationale (which is "informative") in
http://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
states: "I/O is intended to be atomic to ordinary files and pipes and
FIFOs. Atomic means that all the bytes from a single operation that
started out together end up together, without interleaving from other
I/O operations."  This is slightly different.  OTOH, the description
does indicate that short reads from files can only occur due to EOF or
interrupt (or exceeding {SSIZE_MAX}).

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20160524/6c79d0cb/attachment.sig>


More information about the freebsd-hackers mailing list