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
__fbufsize.c
__flbf.c
__fpending.c
__fpurge.c
__freadable.c
__freading.c
__fsetlocking.c
__fwritable.c
__fwriting.c
.cvsignore
Banner
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
bug-ungetwc2.c Update. 2002-04-24 21:09:14 +00:00
clearerr_u.c
clearerr.c
Depend
fcloseall.c
feof_u.c
feof.c
ferror_u.c
ferror.c
filedoalloc.c Update. 2002-07-06 06:36:39 +00:00
fileno.c
fileops.c * libio/fileops.c (_IO_file_sync_mmap): New function. 2002-08-02 01:29:37 +00:00
fmemopen.c
fputc_u.c
fputc.c
fputwc_u.c
fputwc.c
freopen64.c Update. 2002-07-10 23:09:16 +00:00
freopen.c Update. 2002-07-10 23:09:16 +00:00
fseek.c
fseeko64.c
fseeko.c
ftello64.c
ftello.c
fwide.c
fwprintf.c
fwscanf.c
genops.c
getc_u.c
getc.c
getchar_u.c
getchar.c
getwc_u.c
getwc.c
getwchar_u.c
getwchar.c
iofclose.c
iofdopen.c 2002-07-31 Roland McGrath <roland@frob.com> 2002-08-02 01:27:53 +00:00
iofflush_u.c
iofflush.c
iofgetpos64.c
iofgetpos.c
iofgets_u.c
iofgets.c
iofgetws_u.c
iofgetws.c
iofopen64.c
iofopen.c 2002-07-31 Roland McGrath <roland@frob.com> 2002-08-02 01:27:53 +00:00
iofopncook.c
iofputs_u.c
iofputs.c
iofputws_u.c
iofputws.c
iofread_u.c
iofread.c
iofsetpos64.c
iofsetpos.c
ioftell.c
iofwide.c
iofwrite_u.c
iofwrite.c
iogetdelim.c
iogetline.c
iogets.c
iogetwline.c
iolibio.h Update. 2002-02-26 01:45:59 +00:00
iopadn.c
iopopen.c
ioputs.c
ioseekoff.c
ioseekpos.c
iosetbuffer.c
iosetvbuf.c
ioungetc.c
ioungetwc.c
iovdprintf.c
iovsprintf.c
iovsscanf.c
iovswscanf.c
iowpadn.c
libio.h
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
obprintf.c
oldfileops.c
oldiofclose.c
oldiofdopen.c
oldiofgetpos64.c
oldiofgetpos.c
oldiofopen.c
oldiofsetpos64.c
oldiofsetpos.c
oldiopopen.c
oldpclose.c
oldstdfiles.c
oldtmpfile.c
pclose.c
peekc.c
putc_u.c
putc.c
putchar_u.c
putchar.c
putwc_u.c
putwc.c
putwchar_u.c
putwchar.c
rewind.c
setbuf.c
setlinebuf.c
stdfiles.c
stdio.c
stdio.h 2002-07-31 Jeff Bailey <jbailey@gnu.org> 2002-07-31 23:30:24 +00:00
strfile.h
strops.c
swprintf.c
swscanf.c
test-fmemopen.c
test-freopen.c
test-freopen.sh
tst_getwc.c
tst_getwc.input
tst_putwc.c
tst_swprintf.c
tst_swscanf.c
tst_wprintf2.c
tst_wprintf.c
tst_wscanf.c
tst_wscanf.input
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
tst-fgetws.c
tst-fopenloc.c
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
tst-sscanf.c
tst-swscanf.c
tst-ungetwc1.c
tst-ungetwc2.c
tst-widetext.c
tst-widetext.input
vasprintf.c
Versions
vscanf.c
vsnprintf.c
vswprintf.c
vwprintf.c
vwscanf.c
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
wprintf.c
wscanf.c
wstrops.c