1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

* libio/fileops.c (_IO_file_seekoff_mmap): Don't rely on FP->_offset,

which gets moved around.  Calculate size of mmap'd buffer instead.
This commit is contained in:
Roland McGrath
2002-07-24 22:54:53 +00:00
parent bb0ec5bdb4
commit 11d657d727
2 changed files with 7 additions and 1 deletions

View File

@ -932,7 +932,8 @@ _IO_file_seekoff_mmap (fp, offset, dir, mode)
using a pushback buffer, but in the usual case has the same value as
(fp->_IO_read_ptr - fp->_IO_buf_base). */
if (mode == 0)
return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);
return ((fp->_IO_buf_end - fp->_IO_buf_base)
- (fp->_IO_read_end - fp->_IO_read_ptr));
switch (dir)
{