Commit Graph

715 Commits

Author SHA1 Message Date
Siddhesh Poyarekar 4573c6b098 Adjust wide data buffer pointers during fseek and ftell
[BZ #14543]
Set the internal buffer state correctly whenever the external buffer
state is modified by fseek by either computing the current
_IO_read_ptr/end for the internal buffer based on the new _IO_read_ptr
in the external buffer or converting the content read into the
external buffer, up to the extent of the requested fseek offset.
2012-09-28 18:21:39 +05:30
Joseph Myers 203e56032f Remove various _G_*_t type names. 2012-09-25 12:37:37 +00:00
Siddhesh Poyarekar 2b4f00d1a4 Fix minor typos in comments 2012-09-25 09:28:43 +05:30
Dmitry V. Levin 57c69bef13 Set "fail on error" mode directly in testsuite shell scripts 2012-09-25 02:48:31 +00:00
Joseph Myers 431531094f Remove _G_HAVE_SYS_WAIT and _IO_HAVE_SYS_WAIT. 2012-09-21 10:02:03 +00:00
Joseph Myers 8a26625d21 Remove _G_NEED_STDARG_H. 2012-09-20 14:41:02 +00:00
Joseph Myers b7aaa4d6d2 Remove _G_HAVE_IO_GETLINE_INFO. 2012-09-17 11:43:06 +00:00
Joseph Myers ad35fc005b Remove _G_HAVE_PRINTF_FP. 2012-09-13 16:13:09 +00:00
Joseph Myers 28361c5ee4 Remove _G_USING_THUNKS. 2012-09-10 22:05:49 +00:00
Joseph Myers 0e886ef96e Remove libio C++ vtable definitions. 2012-09-10 21:22:42 +00:00
H.J. Lu bcba7aa24d Run tst-fopenloc if $(build-shared) is yes 2012-09-10 11:13:54 -07:00
Siddhesh Poyarekar 1ffb8c9001 Fix typos in comments
* libio/fileops.c: Fix typos in comments.
        * libio/oldfileops.c: Likewise.
        * libio/wfileops.c: Likewise.
2012-09-05 22:04:57 +05:30
Joseph Myers 60160d83a0 Fix iogetdelim.c (latent) integer overflow (bug 9914). 2012-09-04 11:24:43 +00:00
Roland McGrath b2e1c56272 Make libio compile without _IO_MTSAFE_IO. 2012-08-17 09:35:36 -07:00
Roland McGrath c75ccd4c3a Clean up definition of _LIBC_REENTRANT and _IO_MTSAFE_IO. 2012-08-17 09:35:15 -07:00
Roland McGrath 03af952060 Clean up lockf64, fseeko64, ftello64, fgetpos64, fsetpos64 for off64_t == off_t. 2012-08-06 16:48:14 -07:00
Roland McGrath 2747bf9adf Clean up fopen64 for O_LARGEFILE==0. 2012-08-01 16:30:47 -07:00
Roland McGrath bea9b19322 Fix lots of bitrot for stub configurations. 2012-07-30 16:34:33 -07:00
Andreas Schwab d18ea0c5e6 Remove use of INTDEF/INTUSE in libio 2012-05-24 23:06:20 +02:00
Thomas Schwinge dc70356cbf Avoid dup3 PLT usage.
Fixes fallout from 5aa3a74a59.
2012-05-12 10:53:04 +08:00
Thomas Schwinge 37233df9d1 Hurd: #include <kernel-features.h> 2012-05-10 15:57:24 -07:00
Joseph Myers 54b71e0283 Fix conditions on checking versions of dprintf (bug 13775). 2012-05-03 18:42:37 +00:00
Marek Polacek 5ac3ea17df Fix attributes for fortify functions. 2012-04-29 15:34:20 +02:00
Roland McGrath ec98af7d1b Update comment for _io_write_fn
[BZ #2074]
	* libio/libio.h (__io_write_fn): Update comment.
2012-04-12 21:02:00 +02:00
Jim Meyering 288f9098cb Remove __wur from fwrite, fwrite_unlocked
[BZ #11959]
        * libio/stdio.h (fwrite, fwrite_unlocked): Remove __wur.
        It is not necessarily an error to ignore fwrite's return
        value.  One can reliably use ferror to test for errors after
        the fact.
2012-04-11 21:03:57 +02:00
David S. Miller 20fde22738 Remove xsputn small copy optimization.
* libio/fileops.c (_IO_new_file_xsputn): Don't try to optimize
	small copies by hand.
2012-03-29 14:38:27 -07:00
Joseph Myers c6e013c15e Always declare gets for C++ up to C++11 without checking __USE_GNU. 2012-03-09 22:08:39 +00:00
Ulrich Drepper a4300c7a4d Remove distribute variable from Makefiles 2012-03-07 05:17:13 -05:00
Roland McGrath 36c8acb4f8 BZ#13775: Fix vdprintf/dprintf ldbl-compat decl feature test conditional. 2012-02-27 14:00:47 -08:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Marek Polacek 6b73181ac5 Remove _G_HAVE_SYS_CDEFS. 2012-02-09 17:09:55 +01:00
Marek Polacek 69db4f8f46 Remove PARAMS macros. 2012-01-31 20:02:53 +00:00
Joseph Myers c8a89e7dd5 Remove miscellaneous __STDC__ conditionals. 2012-01-30 21:20:32 +00:00
Joseph Myers 965a54a4ee Remove __STDC__ conditionals from non-installed headers. 2012-01-26 23:31:37 +00:00
Joseph Myers 7071ad79db Remove __STDC__ conditionals from installed headers. 2012-01-26 20:49:22 +00:00
Marek Polacek e0a309cf2a Don't always provide definition of gets checking version 2012-01-13 12:45:02 -05:00
Ulrich Drepper a784e50247 Remove pre-ISO C support
No more __const.
2012-01-07 23:57:22 -05:00
Ulrich Drepper c3a8723670 Do not declare gets in _GNU_SOURCE mode at all 2012-01-07 10:41:00 -05:00
Joseph Myers 8ecd6b2a12 Fix C11 header changes for C++. 2012-01-06 18:11:50 +00:00
Ulrich Drepper 16578fa7b3 Better gets prototype and fallout from removal 2012-01-01 07:17:22 -05:00
Ulrich Drepper 03a718297d Remove gets declaration 2012-01-01 07:17:20 -05:00
Marek Polacek aaddc98c25 Remove unused variables 2011-11-11 13:27:59 -05:00
Andreas Schwab 7583a88d1c Fix locking in _IO_flush_all_lockp 2011-11-07 15:20:59 +01:00
Ulrich Drepper 9beb233493 Mark a few more functions with __THROWNL. 2011-10-29 15:56:44 -04:00
Roland McGrath 94d44d9f4d Remove mention of open_obstack_stream, which has never existed in libio. 2011-10-26 16:53:02 -07:00
Ulrich Drepper ab6737ffd0 Avoid warning in iofwide 2011-10-15 09:52:26 -04:00
Ulrich Drepper f22e10748f Don't lock string streams in stream cleanup code 2011-09-09 16:15:25 -04:00
Andreas Jaeger a101b025af Fix fopen (non-existing-file, "re") errno 2011-08-20 09:12:49 -04:00
Ulrich Drepper 798be72d12 Define SEEK_DATA and SEEK_HOLE 2011-07-23 21:45:57 -04:00
Ulrich Drepper aec84f5395 Set stream errors in more cases
Also avoid unnecessarily setting errno when testing for TTY.
2011-05-21 00:42:06 -04:00
Ulrich Drepper ed690b2f24 Cleanup namespace use. 2011-05-19 21:09:29 -04:00
H.J. Lu 0a197a9dfe Fix fileops.c build for old kernels 2011-05-17 01:45:49 -04:00
Ulrich Drepper 94b7cc3711 Fix a few problems in fopen and freopen
fopen should set the FD_CLOEXEC flag if requested evenif the kernel does
not support an aotmic operation.

freopen should reuse the file descriptor for the stream.  This is
especially important for calls to change the standard streams (stin,
stdout, stderr).
2011-05-15 15:28:46 -04:00
Ulrich Drepper ca408c157c Initialize variable in _IO_new_file_close_it
The last change left a variable in some situations uninitialized.
2011-05-14 10:59:54 -04:00
Ulrich Drepper 20030ae6d7 Fix error messages in test. 2011-05-13 21:10:29 -04:00
Ulrich Drepper fcabc0f8b1 Fix file descriptor position after fclose
fclose should leave the file descriptor position after the last read
or written byte.
2011-05-13 21:08:45 -04:00
Eric Blake b722481ac2 Use al possible bytes from fopen mode string. 2011-04-22 23:40:57 -04:00
Jim Meyering ded5b9b7c7 Remove doubled words. 2011-04-22 21:34:32 -04:00
Ulrich Drepper 4c1423edfb Fix typos in comments. 2011-04-01 10:39:30 -04:00
Ulrich Drepper 13a804de8f Optimize fmemopen a bit. 2011-03-04 00:49:46 -05:00
Andreas Schwab 9d25c392ba Don't read past end of buffer in fmemopen 2011-03-04 00:48:00 -05:00
Andreas Schwab 817328eea7 Remove undefined operations 2010-09-05 13:55:08 +02:00
Jakub Jelinek f32f28695d Fix a couple of __REDIRECT () __THROW occurrences
This patch fixes some cases which fail to parse with C++.
2010-06-14 08:18:26 -07:00
Ulrich Drepper 7ca890b88e Fix reporting of I/O errors in *dprintf functions. 2010-02-24 16:07:57 -08:00
Ulrich Drepper cd2f000c07 Fix standalone stdio.h inclusion. 2010-01-10 00:39:22 -08:00
Ulrich Drepper df1934daa7 Fix getwc* and putwc* on non-wide streams. 2009-11-19 10:29:16 -08:00
Ulrich Drepper 7f3146e789 Implement mkstemps and mkstemps64. 2009-10-30 00:11:07 -07:00
Ulrich Drepper cc88b371a5 Fix return value of puts for very long strings. 2009-10-29 16:03:07 -07:00
Roland McGrath 487a6d7735 Remove some unused variables. 2009-09-19 17:19:41 -07:00
Andreas Schwab 5d2e69766a Fix fsetpos on wide stream. 2009-09-02 19:45:33 -07:00
Andreas Schwab d840539e12 Cleanup _IO_wfile_seekoff.
This reformulates the in-buffer optimisation check to match the code in
_IO_new_file_seekoff.  No functional changes, but easier to understand.
2009-09-01 15:36:22 -07:00
Andreas Schwab 5182cbc5ab Add hidden alias for fflush. 2009-09-01 15:31:09 -07:00
Ulrich Drepper eae3208e24 Run tst-fgetwc with necessary envvar. 2009-06-16 07:48:27 -07:00
Bruce Dubbs 4155d92633 (do_test): Use de_DE.UTF-8 as locale name. 2009-06-15 17:27:48 -07:00
Ulrich Drepper 0d74e04361 (_IO_new_file_fopen): Don't prematurely stop parsing mode string. 2009-06-09 06:59:02 -07:00
Jim Meyering edeabc047e remove subsumed .gitignore entries and files 2009-05-16 10:41:40 +02:00
Jim Meyering 8636153326 remove mpn-copy.mk from .gitignore files 2009-05-16 10:38:54 +02:00
Jim Meyering bb87237534 remove COPYING* from .gitignore files 2009-05-16 10:38:53 +02:00
Jim Meyering 2e180a2622 rename each .cvsignore file to .gitignore 2009-05-15 18:13:37 +02:00
Ulrich Drepper f521be31b9 * sysdeps/unix/sysv/linux/libc_pthread_init.c (__libc_pthread_init):
Avoid warning by using may_alias attribute on ptrhack.
2009-04-26 18:06:47 +00:00
Ulrich Drepper 1332704275 * libio/tst-widetext.input: Remove surrogates. 2009-04-25 08:39:43 +00:00
Ulrich Drepper a99e59d771 * include/stdio.h (fmemopen): Add libc_hidden_proto.
* libio/fmemopen.c (fmemopen): Add libc_hidden_def.

	* elf/sprof.c: Avoid warning about multi-line comment.
2009-03-10 15:26:57 +00:00
Ulrich Drepper f503060bbb * libio/stdio.h: dprintf, fmemopen, getdelim, getline,
open_memstream, and vdprintf are in POSIX 2008.
2009-02-26 15:44:18 +00:00
Ulrich Drepper a71433e7fd * sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (struct sigevent):
Add _tid slot to maintain consistency with kernel.
2009-02-05 00:21:43 +00:00
Ulrich Drepper 82f2e9c6bd 2009-02-04 Ulrich Drepper <drepper@redhat.com>
* libio/wfileops.c (_IO_wfile_underflow): Fix handling of
	incomplete characters at end of input buffer.
	* libio/Makefile (tests): Add tst-fgetwc.
	* libio/tst-fgetwc.c: New file.
	* libio/tst-fgetwc.input: New file.
2009-02-04 21:27:48 +00:00
Ulrich Drepper 3d44c0b219 Test of fgetwc on unbuffered stream. 2009-02-04 21:25:31 +00:00
Ulrich Drepper 7b3ba2c4eb [BZ #6544]
* libio/fmemopen.c: Implement binary mode.  In this mode no NUL
	byte gets added to writes and seeks from the end use the length of
	the buffer and not the currently terminating NUL byte.
2008-08-14 06:37:17 +00:00
Ulrich Drepper 372aece0e4 * libio/iopopen.c (_IO_new_proc_open): Remove unnecessary volatile. 2008-07-27 22:34:39 +00:00
Ulrich Drepper e038616f4a * posix/wordexp.c (exec_comm): Use pipe2 if possible to create
file descriptors with close-on-exec set.
	(exec_comm_child): Fix the case where the write end of the pipe is
	STDOUT_FILENO already.  In case it is, clear close-on-exec.
2008-07-27 19:08:19 +00:00
Ulrich Drepper d6e0c2a67d * sysdeps/unix/sysv/linux/syscalls.list: Add __pipe2 alias.
* io/pipe2.c: Likewise.
	* sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_PIPE2
	instead of __ASSUME_PACCEPT.
	* include/unistd.h: Declare __have_pipe2.
	* libio/iopopen.c: Implement "e" flag.
	* libio/Makefile (tests): Add tst-popen1.
	* libio/tst-popen1.c: New file.
2008-07-27 18:26:13 +00:00
Ulrich Drepper 11ed3eaed9 * sysdeps/unix/sysv/linux/bits/socket.h: Define PF_ISDN and AF_ISDN.
* sysdeps/unix/sysv/linux/sparc/bits/socket.h: Likewise.
2008-07-27 08:25:37 +00:00
Ulrich Drepper c4a710b6b0 [BZ #6771]
* libio/fileops.c (_IO_new_file_attach): Preserve errno around
	success call of _IO_SEEKOFF or calls which failed because the
	descriptor is for a pipe.
2008-07-26 23:42:14 +00:00
Ulrich Drepper 38dc8fad64 [BZ #6719]
2008-07-08  Ulrich Drepper  <drepper@redhat.com>
	[BZ #6719]
	* libio/iosetvbuf.c (_IO_setvbuf): Correctly clear buffering flags
	when selecting fully-buffered stream.
	Patch by Wang Xin <wxinee@gmail.com>.
2008-07-08 16:21:11 +00:00
Ulrich Drepper 62605cbfcb Remove useless more "if" tests before "free".
* include/inline-hashtab.h (htab_delete): Likewise.
	* libio/freopen.c (freopen): Likewise.
	* libio/freopen64.c (freopen64): Likewise.
	* locale/programs/ld-collate.c (collate_read): Likewise.
	* misc/fstab.c (libc_freeres_fn): Likewise.
	* posix/glob.c (globfree): Likewise.
2008-05-27 06:04:07 +00:00
Jakub Jelinek ad8a551196 * libio/stdio.h (vscanf): Fix -std=c99 redirect.
* stdio-common/Makefile (tests): Add scanf16 and scanf17. 
(CFLAGS-scanf17.c): New. 
* stdio-common/scanf14.c (main): Add fscanf and scanf tests. 
* stdio-common/scanf15.c (main): Likewise. 
* stdio-common/scanf16.c: New test. 
* stdio-common/scanf17.c: New test.
2008-05-24  Jakub Jelinek  <jakub@redhat.com>

	* libio/stdio.h (vscanf): Fix -std=c99 redirect.
	* stdio-common/Makefile (tests): Add scanf16 and scanf17.
	(CFLAGS-scanf17.c): New.
	* stdio-common/scanf14.c (main): Add fscanf and scanf tests.
	* stdio-common/scanf15.c (main): Likewise.
	* stdio-common/scanf16.c: New test.
	* stdio-common/scanf17.c: New test.
2008-05-24 18:14:36 +00:00
Ulrich Drepper a7925a24fe [BZ #5998]
2008-04-09  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5998]
	* libio/iofwrite.c (_IO_fwrite): Return correct count if flushing
	in line-buffered stream failed.
	* libio/iofwrite_u.c (fwrite_unlocked): Likewise.
2008-04-09 07:42:19 +00:00
Ulrich Drepper 72e6cdfa2c Remove useless "if" before "free". 2008-03-19 06:43:34 +00:00
Ulrich Drepper dff3751503 * include/stdio.h (__asprintf_chk, __dprintf_chk,
__obstack_printf_chk): New prototypes.
	(__vasprintf_chk, __vdprintf_chk,
	__obstack_vprintf_chk): Likewise.
	Add libc_hidden_proto.
	* libio/obprintf.c
	(_IO_obstack_jumps): No longer static, add attribute_hidden.
	* libio/bits/stdio-ldbl.h (__asprintf_chk, __dprintf_chk,
	__obstack_printf_chk, __vasprintf_chk, __vdprintf_chk,
	__obstack_vprintf_chk): Add __LDBL_REDIR_DECL.
	* libio/bits/stdio2.h (__asprintf_chk, __dprintf_chk,
	__obstack_printf_chk, __vasprintf_chk, __vdprintf_chk,
	__obstack_vprintf_chk): New prototypes.
	(asprintf, __asprintf, dprintf, obstack_printf, vasprintf, vdprintf,
	obstack_vprintf): New inlines.
	* debug/dprintf_chk.c: New file.
	* debug/vdprintf_chk.c: New file.
	* debug/asprintf_chk.c: New file.
	* debug/vasprintf_chk.c: New file.
	* debug/obprintf_chk.c: New file.
	* debug/tst-chk1.c (do_test): Add asprintf and obstack_printf tests.
	* debug/Versions (__asprintf_chk, __dprintf_chk, __obstack_printf_chk,
	__vasprintf_chk, __vdprintf_chk, __obstack_vprintf_chk): Export
	@@GLIBC_2.8.
	* debug/Makefile: Build asprintf_chk, vasprintf_chk, dprintf_chk,
	vdprintf_chk and obprintf_chk, set CFLAGS for them.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.c (__nldbl___vasprintf_chk,
	__nldbl___vdprintf_chk, __nldbl___obstack_vprintf_chk): Add
	libc_hidden_proto.
	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (__nldbl___vasprintf_chk,
	__nldbl___vdprintf_chk, __nldbl___obstack_vprintf_chk): New prototypes.
	* sysdeps/ieee754/ldbl-opt/Versions (__nldbl___asprintf_chk,
	__nldbl___vasprintf_chk, __nldbl___dprintf_chk, __nldbl___vdprintf_chk,
	__nldbl___obstack_printf_chk, __nldbl___obstack_vprintf_chk): Export
	@@GLIBC_2.8.
	* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add asprintf_chk,
	vasprintf_chk, dprintf_chk, vdprintf_chk, obstack_printf_chk and
	obstack_vprintf_chk.
	* sysdeps/ieee754/ldbl-opt/nldbl-obstack_vprintf_chk.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-dprintf_chk.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-obstack_printf_chk.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-asprintf_chk.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-vdprintf_chk.c: New file.
	* sysdeps/ieee754/ldbl-opt/nldbl-vasprintf_chk.c: New file.
2008-03-05 07:05:13 +00:00
Ulrich Drepper 4e3be9d651 (vscanf): Fix definition for loser compilers. 2008-01-08 01:18:40 +00:00
Ulrich Drepper fa76dde2cf * include/time.h: Declare __tzset_parse_tz and __tzset_compute.
* time/tzset.c (tzset_internal): Break TZ string parsing out into
	__tzset_parse_tz and updating of daylight, timezone, tzname into
	update_vars.
	(__tz_compute): Renamed from tz_compute.  Take additional parameters.
	(__tz_convert): Updating of tm_isdst, tm_zone, and tm_gmtoff now
	happens in __tz_compute.
	* time/tzfile.c (__tzfile_read): Also read TZ string.
	(find_transition): Fold into __tzfile_compute.
	(__tzfile_compute): For times beyond the last transition try to
	use the TZ string.
	* timezone/tst-timezone.c: Information in daylight and tzname does
	change for Asia/Tokyo timezone with more concrete information.
	Remove the test.

	* include/stdio.h: Add libc_hidden_proto for ftello.
	* libio/ftello.c: Add libc_hidden_def.
2007-10-14 09:15:45 +00:00