summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1994-10-26 05:35:04 +0000
committerRoland McGrath <roland@gnu.org>1994-10-26 05:35:04 +0000
commita24b777239001b78b9e7abdd2c6c64c819e739f4 (patch)
treee6f1dd38a985c539fc84fd408ef8616b5029e3da
parent010d97b4aa9a52a9abf276cc8315db1e85341361 (diff)
(Open-time Flags): Say POSIX.1 requires write access for O_TRUNC.
Say O_TRUNC is no better than ftruncate and only historical.
-rw-r--r--manual/llio.texi16
1 files changed, 10 insertions, 6 deletions
diff --git a/manual/llio.texi b/manual/llio.texi
index aae7b0e1aa..2cb0151bba 100644
--- a/manual/llio.texi
+++ b/manual/llio.texi
@@ -1407,12 +1407,16 @@ can do them @i{atomically}.
@comment POSIX.1
@deftypevr Macro int O_TRUNC
Truncate the file to zero length. This option is only useful for
-regular files, not special files such as directories or FIFOs. You have
-permission to write the file to truncate it, but you need not open for
-write access.
-
-This is the only open-time action flag specified by POSIX.1.
-@c !!! not atomic? check posix.1
+regular files, not special files such as directories or FIFOs. POSIX.1
+requires that you open the file for writing to use @code{O_TRUNC}. In
+BSD and GNU you must have permission to write the file to truncate it,
+but you need not open for write access.
+
+This is the only open-time action flag specified by POSIX.1. There is
+no good reason for truncation to be done by @code{open}, instead of by
+calling @code{ftruncate} afterwards. The @code{O_TRUNC} flag existed in
+Unix before @code{ftruncate} was invented, and is retained for backward
+compatibility.
@end deftypevr
@comment fcntl.h