glibc/libio
Roland McGrath acbee5f637 * libio/fileops.c (_IO_file_sync_mmap): New function.
(_IO_file_jumps_mmap): Use it.
	(_IO_file_underflow_mmap): Rewritten.  If after EOF or fflush,
	repeat the stat check and resize the mapped buffer as necessary.

2002-07-31  Roland McGrath  <roland@frob.com>

	* libio/fileops.c (decide_maybe_mmap): New static function.
	Code taken from libio/iofopen.c:__fopen_maybe_mmap to try to
	mmap the file contents.  Then switch the jump tables to the mmap
	tables if it worked, or the vanilla file tables if not.
	(_IO_file_underflow_maybe_mmap): New function.
	(_IO_file_seekoff_maybe_mmap): New function.
	(_IO_file_xsgetn_maybe_mmap): New function.
	(_IO_file_jumps_maybe_mmap): New variable, jump table using those.
	* libio/libioP.h: Declare those.
	* libio/wfileops.c (_IO_wfile_underflow_maybe_mmap): New function.
	(_IO_wfile_jumps_maybe_mmap): New variable, jump table using that.
	* libio/iofopen.c (__fopen_maybe_mmap): Don't try to mmap here.
	If the stream is read-only, set its jump tables to those new ones.
	* libio/iofdopen.c (_IO_new_fdopen) [_G_HAVE_MMAP]: Set the initial
	jump tables to the maybe_mmap ones, and don't call __fopen_maybe_mmap.
	We need the tables set before _IO_file_attach.

	* libio/tst-mmap-eofsync.c: New file.
	* libio/tst-mmap-fflushsync.c: New file.
	* libio/bug-mmap-fflush.c: New file.
	* libio/tst-mmap2-eofsync.c: New file.
	* libio/Makefile (tests): Add them.

	* libio/wfileops.c (_IO_wfile_underflow_mmap): Don't set EOF bit when
	_IO_file_underflow_mmap fails, it already set the appropriate bit.
2002-08-02 01:29:37 +00:00
..
bits Update. 2001-08-02 16:11:13 +00:00
__fbufsize.c Update. 2002-04-09 20:36:24 +00:00
__flbf.c Update. 2002-04-09 20:36:24 +00:00
__fpending.c Update. 2002-04-09 20:36:24 +00:00
__fpurge.c Update. 2002-04-09 20:36:24 +00:00
__freadable.c Update. 2002-04-09 20:36:24 +00:00
__freading.c Update. 2002-04-09 20:36:24 +00:00
__fsetlocking.c Update. 2002-04-09 20:36:24 +00:00
__fwritable.c Update. 2002-04-09 20:36:24 +00:00
__fwriting.c Update. 2002-04-09 20:36:24 +00:00
.cvsignore Tue May 14 14:07:10 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu> 1996-05-14 20:30:25 +00:00
Banner update from main archive 960907 1996-09-07 23:56:19 +00:00
bug-fseek.c Update. 2002-07-24 11:18:48 +00:00
bug-mmap-fflush.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
bug-rewind.c Update. 2002-07-22 22:25:20 +00:00
bug-ungetc.c 2002-07-24 Roland McGrath <roland@frob.com> 2002-07-24 09:34:59 +00:00
bug-ungetwc1.c Update. 2002-04-03 09:26:58 +00:00
bug-ungetwc2.c Update. 2002-04-24 21:09:14 +00:00
clearerr_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
clearerr.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
Depend New file, libio needs localedata for tests. 2000-07-29 07:57:34 +00:00
fcloseall.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
feof_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
feof.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
ferror_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
ferror.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
filedoalloc.c Update. 2002-07-06 06:36:39 +00:00
fileno.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fileops.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
fmemopen.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fputc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fputc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fputwc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fputwc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
freopen64.c Update. 2002-07-10 23:09:16 +00:00
freopen.c Update. 2002-07-10 23:09:16 +00:00
fseek.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fseeko64.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fseeko.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
ftello64.c Update. 2002-02-26 01:45:59 +00:00
ftello.c Update. 2002-02-26 01:45:59 +00:00
fwide.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
fwprintf.c Update. 2001-08-17 07:51:36 +00:00
fwscanf.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
genops.c Update. 2002-02-26 01:45:59 +00:00
getc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getchar_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getchar.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getwc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getwc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getwchar_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
getwchar.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofclose.c Update. 2002-04-03 03:12:43 +00:00
iofdopen.c 2002-07-31 Roland McGrath <roland@frob.com> 2002-08-02 01:27:53 +00:00
iofflush_u.c Update. 2002-02-26 01:45:59 +00:00
iofflush.c Update. 2002-02-26 01:45:59 +00:00
iofgetpos64.c Update. 2002-02-26 01:45:59 +00:00
iofgetpos.c Update. 2002-02-26 01:45:59 +00:00
iofgets_u.c Update. 2002-02-26 01:45:59 +00:00
iofgets.c Update. 2002-02-26 01:45:59 +00:00
iofgetws_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofgetws.c update. 2001-08-09 00:11:12 +00:00
iofopen64.c Update. 2002-01-07 09:33:53 +00:00
iofopen.c 2002-07-31 Roland McGrath <roland@frob.com> 2002-08-02 01:27:53 +00:00
iofopncook.c Update. 2002-02-26 01:45:59 +00:00
iofputs_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofputs.c Update. 2002-02-26 01:45:59 +00:00
iofputws_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofputws.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofread_u.c Update. 2002-02-26 01:45:59 +00:00
iofread.c Update. 2002-02-26 01:45:59 +00:00
iofsetpos64.c Update. 2002-02-26 01:45:59 +00:00
iofsetpos.c Update. 2002-02-26 01:45:59 +00:00
ioftell.c Update. 2002-02-26 01:45:59 +00:00
iofwide.c Update. 2002-03-13 06:33:52 +00:00
iofwrite_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
iofwrite.c Update. 2002-02-26 01:45:59 +00:00
iogetdelim.c Realloc error handling memory leak fix. 2001-12-29 15:57:15 +00:00
iogetline.c Update. 2002-02-26 01:45:59 +00:00
iogets.c Update. 2002-02-26 01:45:59 +00:00
iogetwline.c Update. 2002-02-26 01:45:59 +00:00
iolibio.h Update. 2002-02-26 01:45:59 +00:00
iopadn.c Update. 2002-02-26 01:45:59 +00:00
iopopen.c Update. 2002-02-26 01:45:59 +00:00
ioputs.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
ioseekoff.c Update. 2002-02-26 01:45:59 +00:00
ioseekpos.c Update. 2002-02-26 01:45:59 +00:00
iosetbuffer.c Update. 2002-02-26 01:45:59 +00:00
iosetvbuf.c Update. 2002-06-22 05:24:45 +00:00
ioungetc.c Update. 2002-02-26 01:45:59 +00:00
ioungetwc.c Update. 2002-02-26 01:45:59 +00:00
iovdprintf.c Update. 2002-02-26 01:45:59 +00:00
iovsprintf.c Update. 2002-02-26 01:45:59 +00:00
iovsscanf.c Update. 2002-02-26 01:45:59 +00:00
iovswscanf.c Update. 2001-08-11 05:19:24 +00:00
iowpadn.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
libio.h Update. 2002-03-13 02:17:12 +00:00
libioP.h 2002-07-31 Roland McGrath <roland@frob.com> 2002-08-02 01:27:53 +00:00
Makefile * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
memstream.c Update. 2002-06-22 05:24:45 +00:00
obprintf.c Update. 2002-02-26 01:45:59 +00:00
oldfileops.c Update. 2002-02-26 01:45:59 +00:00
oldiofclose.c Update. 2002-02-26 01:45:59 +00:00
oldiofdopen.c Update. 2002-02-26 01:45:59 +00:00
oldiofgetpos64.c Update. 2002-02-26 01:45:59 +00:00
oldiofgetpos.c Update. 2002-02-26 01:45:59 +00:00
oldiofopen.c Update. 2002-02-26 01:45:59 +00:00
oldiofsetpos64.c Update. 2002-02-26 01:45:59 +00:00
oldiofsetpos.c Update. 2002-02-26 01:45:59 +00:00
oldiopopen.c Update. 2002-02-26 01:45:59 +00:00
oldpclose.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
oldstdfiles.c Update. 2002-02-26 01:45:59 +00:00
oldtmpfile.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
pclose.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
peekc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putc.c Update. 2002-02-26 01:45:59 +00:00
putchar_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putchar.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putwc_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putwc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putwchar_u.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
putwchar.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
rewind.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
setbuf.c Update. 2002-02-26 01:45:59 +00:00
setlinebuf.c Update. 2002-02-26 01:45:59 +00:00
stdfiles.c Update. 2002-03-13 02:17:12 +00:00
stdio.c Update. 2002-03-17 12:09:12 +00:00
stdio.h 2002-07-31 Jeff Bailey <jbailey@gnu.org> 2002-07-31 23:30:24 +00:00
strfile.h Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
strops.c Update. 2002-02-26 01:45:59 +00:00
swprintf.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
swscanf.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
test-fmemopen.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
test-freopen.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
test-freopen.sh Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
tst_getwc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
tst_getwc.input Update. 2000-06-23 06:22:36 +00:00
tst_putwc.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
tst_swprintf.c Update. 2001-12-14 07:26:22 +00:00
tst_swscanf.c Update. 2001-02-09 17:57:28 +00:00
tst_wprintf2.c Update. 2000-07-20 08:56:12 +00:00
tst_wprintf.c Update. 2000-06-17 19:22:43 +00:00
tst_wscanf.c Update. 2001-02-09 17:57:28 +00:00
tst_wscanf.input Update. 1999-06-16 22:55:47 +00:00
tst-atime.c Update. 2002-06-25 19:33:56 +00:00
tst-eof.c pdate. 2002-07-23 00:31:41 +00:00
tst-ext.c Update. 2001-03-27 00:16:51 +00:00
tst-fgetws.c update. 2001-08-09 00:11:12 +00:00
tst-fopenloc.c Update. 2001-07-27 18:09:56 +00:00
tst-freopen.c Update. 2002-07-25 01:30:57 +00:00
tst-mmap2-eofsync.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
tst-mmap-eofsync.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
tst-mmap-fflushsync.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
tst-mmap-setvbuf.c Update. 2002-06-22 05:24:45 +00:00
tst-sscanf.c Update. 2001-08-22 18:40:06 +00:00
tst-swscanf.c Update. 2002-02-26 18:08:08 +00:00
tst-ungetwc1.c * libio/tst-ungetwc1.c (main): Add a const to quiet a warning. 2001-08-23 08:36:47 +00:00
tst-ungetwc2.c Update. 2001-08-17 04:49:12 +00:00
tst-widetext.c Update. 2002-01-19 17:51:34 +00:00
tst-widetext.input Update. 2000-07-25 21:09:46 +00:00
vasprintf.c Update. 2002-02-26 01:45:59 +00:00
Versions Update. 2000-09-01 08:56:06 +00:00
vscanf.c Update. 2002-02-26 01:45:59 +00:00
vsnprintf.c Update. 2002-02-26 01:45:59 +00:00
vswprintf.c Update. 2002-06-22 05:24:45 +00:00
vwprintf.c Update. 2001-08-17 07:51:36 +00:00
vwscanf.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
wfiledoalloc.c Update. 2002-07-06 06:36:39 +00:00
wfileops.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
wgenops.c Update. 2002-06-22 05:24:45 +00:00
wprintf.c Update. 2001-08-17 07:51:36 +00:00
wscanf.c Update to LGPL v2.1. 2001-07-06 04:58:11 +00:00
wstrops.c Update. 2002-06-22 05:24:45 +00:00