about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-05-27 13:54:19 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-05-27 13:54:19 +0530
commit2482ae433a4249495859343ae1fba408300f2c2e (patch)
tree9fdaad4e75acb1672022be1c49862ee726134bd9 /ChangeLog
parentbab900166e8b5f0f4081c5cf1afa0cd33b123714 (diff)
downloadglibc-2482ae433a4249495859343ae1fba408300f2c2e.tar.gz
glibc-2482ae433a4249495859343ae1fba408300f2c2e.tar.xz
glibc-2482ae433a4249495859343ae1fba408300f2c2e.zip
Fix offset computation for append+ mode on switching from read (BZ #16724)
The offset computation in write mode uses the fact that _IO_read_end
is kept in sync with the external file offset.  This however is not
true when O_APPEND is in effect since switching to write mode ought to
send the external file offset to the end of file without making the
necessary adjustment to _IO_read_end.

Hence in append mode, offset computation when writing should only
consider the effect of unflushed writes, i.e. from _IO_write_base to
_IO_write_ptr.

The wiki has a detailed document that describes the rationale for
offsets returned by ftell in various conditions:

https://sourceware.org/glibc/wiki/File%20offsets%20in%20a%20stdio%20stream%20and%20ftell
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog9
1 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e65407cf4b..1c2aff1191 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-05-27  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	[BZ #16724]
+	* libio/tst-ftell-append.c: New test case.
+	* libio/Makefile (tests): Add test case.
+	* libio/fileops.c (do_ftell): Don't trust _IO_read_end when in
+	append mode.
+	* libio/wfileops.c (do_ftell_wide): Likewise.
+
 2014-05-26  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/fpu/libm-test-ulps: Update.