]> git.ipfire.org Git - thirdparty/man-pages.git/commit
fopen.3: Explain BSD vs glibc "a+" difference
authorenh <enh@google.com>
Wed, 10 Apr 2019 19:30:24 +0000 (12:30 -0700)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 14 Apr 2019 17:12:34 +0000 (19:12 +0200)
commitd66e1f2be34c4abe874a075eeffc0aad83304391
tree97ca2ec18d4f56b4b6d2cb5a88df3739063bc5e7
parentad484960cb8f436d6b3605610b8d9411b6fc56f2
fopen.3: Explain BSD vs glibc "a+" difference

Where is the initial read position for an "a+" stream?

POSIX leaves this unspecified. Most BSD man pages are silent, and MacOS
has the ambiguous "The stream is positioned at the end of the file", not
differentiating between reads and writes other than to say that fseek(3)
does not affect writes. glibc's documentation explicitly specifies that
the initial read position is the beginning of the file.

My new wording is based on the BSD implementations, so you may prefer
to replace the non-glibc section with "unspecified", or indeed remove
all claims about the initial read position.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/fopen.3