fopen.3: Note the open(2) flags that correspond to the 'mode' argument

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-01-05 15:33:13 +13:00
parent f6386ed6ab
commit a8250b9163
1 changed files with 18 additions and 0 deletions

View File

@ -147,6 +147,24 @@ at end-of-file, as if preceded the call:
fseek(stream, 0, SEEK_END);
.fi
.PP
The file descriptor associated with the stream is opened as if by a call to
.BR open (2)
with the following flags:
.RS
.TS
allbox;
lb lb
c l.
fopen() mode open() flags
\fIr\fP O_RDONLY
\fIw\fP O_WRONLY | O_CREAT | O_TRUNC
\fIa\fP O_WRONLY | O_CREAT | O_APPEND
\fIr+\fP O_RDWR
\fIw+\fP O_RDWR | O_CREAT | O_TRUNC
\fIa+\fP O_RDWR | O_CREAT | O_APPEND
.TE
.RE
.\"
.SS fdopen()
The