diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-06-22 05:24:45 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-06-22 05:24:45 +0000 |
commit | bff334e09023c8cf6327e9ff87b117f2331330d2 (patch) | |
tree | 672ea6581c958ce24049e4d569283ae45e09f1d1 /libio/fileops.c | |
parent | 90f0056f74f13f5fc387a8eaf7d0dda974d76468 (diff) | |
download | glibc-bff334e09023c8cf6327e9ff87b117f2331330d2.tar.gz |
Update.
2002-06-17 Jakub Jelinek <jakub@redhat.com>
* elf/dl-lookup.c (_dl_debug_bindings): Use type_class 4 for TLS
lookups.
* elf/rtld.c (dl_main): Move TLS setup code before LD_TRACE_PRELINKING
code. Print TLS modid and offset for modules containing PT_TLS
segments.
2002-06-09 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/dl-brk.c: Move...
* sysdeps/unix/sysv/linux/dl-brk.c: ...here.
* sysdeps/unix/sysv/linux/i386/dl-sbrk.c: Move...
* sysdeps/unix/sysv/linux/dl-sbrk.c: ...here.
2002-06-07 Jakub Jelinek <jakub@redhat.com>
* nss/getXXbyYY_r.c (NEW, NEW1): Define.
(NEW (REENTRANT_NAME)): Strong alias to INTERNAL (REENTRANT_NAME).
(REENTRANT_NAME@@GLIBC_2.1.2): Use NEW (REENTRANT_NAME).
* nss/getXXent_r.c (NEW, NEW1): Define.
(NEW (REENTRANT_GETNAME)): Strong alias to
INTERNAL (REENTRANT_GETNAME).
(REENTRANT_GETNAME@@GLIBC_2.1.2): Use NEW (REENTRANT_GETNAME).
2002-06-21 Ulrich Drepper <drepper@redhat.com>
* libio/fileops.c (_IO_file_setbuf_mmap): New function.
(_IO_file_jumps_mmap): Use it.
* libio/iosetvbuf.c: Don't call _IO_WSETBUF.
* libio/libioP.h: Remove _IO_wdefault_setbuf and
_IO_wdefault_setbuf_internal prorotypes. Add _IO_file_setbuf_mmap
prototype.
* libio/wfileops.c (_IO_wfile_setbuf): Removed.
(_IO_wfile_jumps_mmap): Don't use it anymore.
* libio/wgenops.c (_IO_wdefault_setbuf): Removed.
* libio/memstream.c (_IO_wmem_jumps): Use _IO_default_setbuf not
_IO_wdefault_setbuf.
* libio/vswprintf.c (_IO_wstrn_jumps): Likewise.
* libio/wstrops.c (_IO_wstr_jumps): Likewise.
* stdio-common/vfprintf.c (_IO_helper_jumps): Likewise.
2002-06-05 Jakub Jelinek <jakub@redhat.com>
* libio/Makefile (tests): Add tst-mmap-setvbuf.
* libio/tst-mmap-setvbuf.c: New test.
Diffstat (limited to 'libio/fileops.c')
-rw-r--r-- | libio/fileops.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index 7f833e5094..42bba7aa21 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -440,6 +440,32 @@ _IO_new_file_setbuf (fp, p, len) } INTDEF2(_IO_new_file_setbuf, _IO_file_setbuf) + +_IO_FILE * +_IO_file_setbuf_mmap (fp, p, len) + _IO_FILE *fp; + char *p; + _IO_ssize_t len; +{ + _IO_FILE *result; + + /* Change the function table. */ + _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps; + fp->_wide_data->_wide_vtable = &_IO_wfile_jumps; + + /* And perform the normal operation. */ + result = _IO_new_file_setbuf (fp, p, len); + + /* If the call failed, restore to using mmap. */ + if (result == NULL) + { + _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &_IO_file_jumps_mmap; + fp->_wide_data->_wide_vtable = &_IO_wfile_jumps_mmap; + } + + return result; +} + static int new_do_write __P ((_IO_FILE *, const char *, _IO_size_t)); /* Write TO_DO bytes from DATA to FP. @@ -1293,7 +1319,7 @@ struct _IO_jump_t _IO_file_jumps_mmap = JUMP_INIT(xsgetn, _IO_file_xsgetn_mmap), JUMP_INIT(seekoff, _IO_file_seekoff_mmap), JUMP_INIT(seekpos, _IO_default_seekpos), - JUMP_INIT(setbuf, _IO_new_file_setbuf), + JUMP_INIT(setbuf, (_IO_setbuf_t) _IO_file_setbuf_mmap), JUMP_INIT(sync, _IO_new_file_sync), JUMP_INIT(doallocate, INTUSE(_IO_file_doallocate)), JUMP_INIT(read, INTUSE(_IO_file_read)), |