From a8250b9163f2b0ffab51de7bc0029494b671c3d6 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 5 Jan 2017 15:33:13 +1300 Subject: [PATCH] fopen.3: Note the open(2) flags that correspond to the 'mode' argument Signed-off-by: Michael Kerrisk --- man3/fopen.3 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/man3/fopen.3 b/man3/fopen.3 index 148a4d880..12619976f 100644 --- a/man3/fopen.3 +++ b/man3/fopen.3 @@ -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