Red Hat Bugzilla – Bug 507054
fsetpos/fseek broken for wide-oriented streams
Last modified: 2009-09-07 09:36:49 EDT
Created attachment 348738 [details]
a test case
Description of problem:
The fsetpos and fseek functions does not work for wide-oriented streams.
They leave the file position at the wrong place or cause a segfault.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Compile and run the attached test case.
Actual output of the test case:
Expected output of the test case:
The fflush function seems to affect the behaviour fsetpos. Doing fflush just before fsetpos sometimes makes fsetpos work correctly, but it does not always help.
The bug seems to be connected with this old change, but reverting it breaks other tests.
2002-11-04 Ulrich Drepper <email@example.com>
* libio/wfileops.c (_IO_wfile_seekoff): Don't modify _offset and
_wide_data->_IO_read_end if adjustment can be made in the current
Looks like the equivalent of this change has never been applied to wfileops.c:
2004-12-06 Ulrich Drepper <firstname.lastname@example.org>
* libio/fileops.c (_IO_new_file_seekoff): Fix optimization of in-buffer
seek. Remove dead code.
Fixed in 2.10.90-20.