From 6b74f6c767babd21c8ee3533bf599a90e5c851b2 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 20 Feb 2017 22:33:49 +0100 Subject: [PATCH] lseek.2: O_APPEND overrides the effect of lseek() when doing file writes Signed-off-by: Michael Kerrisk --- man2/lseek.2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/man2/lseek.2 b/man2/lseek.2 index 4ff462066..33ef814a3 100644 --- a/man2/lseek.2 +++ b/man2/lseek.2 @@ -237,6 +237,15 @@ See for a discussion of the relationship between file descriptors, open file descriptions, and files. +If the +.B O_APPEND +file status flag is set on the open file description, +then a +.BR write (2) +.I always +moves the file offset to the end of the file, regardless of the use of +.BR lseek (). + The .I off_t data type is a signed integer data type specified by POSIX.1.