1 2005-07-22 Andrew Lunn <andrew.lunn@ascom.ch>
3 * src/common/fopen.cxx (fopen): Default the open mode to Read
4 until we have process the flags. Initialize the dev handle. These
5 keep the compiler happy.
7 2005-04-11 Jonathan Larmour <jifl@eCosCentric.com>
9 * src/common/stream.cxx (read): don't reference flags.buffering
10 when configured by CDL to be unbuffered.
12 2005-03-27 Andrew Lunn <andrew.lunn@ascom.ch>
14 * include/stdio.h: Added CYGBLD_ATTRIB_{PRINTF|SCANF}_FORMAT where
15 appropriate so the compiler does more checking.
17 2004-12-08 Daniel Neri <daniel.neri@sigicom.se>
19 * cdl/stdio.cdl (CYGPKG_LIBC_STDIO_FILEIO): The FILEIO variant of
20 vsnprintf breaks if CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF is disabled.
22 2004-09-27 Jonathan Larmour <jifl@eCosCentric.com>
24 * cdl/stdio.cdl (CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS): New option,
25 to control whether or not fdopen()/fileno() are implemented.
26 Only build fopen/fclose if CYGPKG_LIBC_STDIO_OPEN.
28 * src/common/fclose.cxx: Can remove ifdef CYGPKG_LIBC_STDIO_OPEN since
29 file now isn't even built if not.
30 * src/common/fopen.cxx: Ditto. Also condition on
31 CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS so decision is centralised in CDL.
33 2004-08-18 Jonathan Larmour <jifl@eCosCentric.com>
35 * cdl/stdio.cdl (CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE): Only use
36 CYGDAT_IO_SERIAL_TTY_CONSOLE if set.
38 2004-08-18 Fredrik Hederstierna <fredrik@wespot.com>
39 2004-08-18 Jonathan Larmour <jifl@eCosCentric.com>
41 * src/input/vfscanf.cxx (vfscanf): Add long long and long double
43 * cdl/stdio.cdl (CYGFUN_LIBC_STDIO_LONGLONG): Make it a new option.
45 2004-08-16 Oyvind Harboe <oyvind.harboe@zylin.com>
47 * src/common/stream.cxx (read): fixed performance problem with
48 unbuffered reads. Long unbuffered i/o read requests would cause
49 one roundtrip to the underlying file system for each byte, instead
50 of a single trip as intended.
52 2004-03-29 Kelvin Lawson <klawson@ad-holdings.co.uk>
54 * src/common/fopen.cxx:
55 * src/common/stream.cxx:
58 Split CYGSTREAM_READWRITE into CYGSTREAM_READWRITE_CREATE and
59 CYGSTREAM_READWRITE_NOCREATE. This fixes fopen() with mode 'w+'
60 which previously did not allow file creation.
62 2004-03-27 Andrew Lunn <andrew.lunn@ascom.ch>
64 * include/stream.inl (set_position): Flush the output buffer
65 before seeking the underlying file otherwise the writes ends up in
66 the wrong location in the file.
68 2004-03-15 Jonathan Larmour <jifl@eCosCentric.com>
70 * src/common/fileops.cxx (tmpnam): Only close if open() succeded.
72 2004-03-12 Jonathan Larmour <jifl@eCosCentric.com>
74 * src/input/vfscanf.cxx (vfscanf): Silence warning.
77 Add file operation functions which weren't here before!
78 While I'm here, add __THROW everywhere and use __externC not externC.
80 * cdl/stdio.cdl: We implement stdio fileops in isoinfra now.
81 Also set header for that.
83 L_tmpnam must be at least 4.
84 TMP_MAX must be at least 1, and ISO C says it should be >=25.
85 Add description for CYGPKG_LIBC_STDIO_FILEIO and move up from
86 bottom so it goes with others.
88 * src/common/fileops.cxx: New file. Implements rename(), remove(),
89 tmpnam() and tmpfile().
91 * src/common/fclose.cxx: Add throw specifiers to match stdio.h.
92 * src/common/feof.cxx: Ditto.
93 * src/common/fflush.cxx: Ditto.
94 * src/common/fopen.cxx: Ditto.
95 * src/common/freopen.cxx: Ditto.
96 * src/common/fseek.cxx: Ditto.
97 * src/common/setvbuf.cxx: Ditto.
98 * src/common/snprintf.cxx: Ditto.
99 * src/common/sprintf.cxx: Ditto.
100 * src/common/sscanf.cxx: Ditto.
101 * src/common/stdioinlines.cxx: Ditto.
102 * src/common/ungetc.cxx: Ditto.
103 * src/common/vsnprintf.cxx: Ditto.
104 * src/common/vsscanf.cxx: Ditto.
105 * src/input/fgetc.cxx: Ditto.
106 * src/input/fgets.cxx: Ditto.
107 * src/input/fread.cxx: Ditto.
108 * src/input/fscanf.cxx: Ditto.
109 * src/input/gets.cxx: Ditto.
110 * src/input/scanf.cxx: Ditto.
111 * src/input/vfscanf.cxx: Ditto.
112 * src/output/fnprintf.cxx: Ditto.
113 * src/output/fprintf.cxx: Ditto.
114 * src/output/fputc.cxx: Ditto.
115 * src/output/fputs.cxx: Ditto.
116 * src/output/fwrite.cxx: Ditto.
117 * src/output/printf.cxx: Ditto.
118 * src/output/vfnprintf.cxx: Ditto.
120 2004-02-17 Jonathan Larmour <jifl@eCosCentric.com>
122 * cdl/stdio.cdl (CYGSEM_LIBC_STDIO_THREAD_SAFE_STREAMS): Can
123 be inactive when no kernel.
124 * cdl/stdio.cdl: Implements file positioning functions in isoinfra.
126 2003-09-03 Thomas Koeller <thomas.koeller@baslerweb.com>
128 * cdl/stdio.cdl: only require "/dev/haldiag" if actually using it.
130 2003-08-12 Scott Wilkinson <scott@alliantnetworks.com>
132 * src/common/fclose.cxx (fclose): fclose would seg-fault if passed
133 NULL FILE pointer. Now returns error. Also cleaned up some exit
134 paths to call Cyg_libc_stdio_files::unlock()
136 * src/common/fopen.cxx (fopen): Cleaned up some exit paths to call
137 Cyg_libc_stdio_files::unlock()
139 2003-06-10 Andrew Lunn <andrew.lunn@ascom.ch>
140 Knud Wöhler <woehler@ossi.fho-emden.de>
142 * src/output/vfnprintf.cxx (SARG): Cast size_t to long. This seems
143 to stop gcc from producing wrong code for the plain int clause. The
144 wrong code causes negative numbers to be printed as positive because
145 the sign extend from 32 bits to 64 bits is wrong.
147 2003-03-06 Gary Thomas <gary@mlbassoc.com>
149 * src/input/fread.cxx (fread): Simple EOF should not set error.
151 * tests/fileio.c: New file.
152 * cdl/stdio.cdl: Add new file I/O tests.
154 2003-02-24 Jonathan Larmour <jifl@eCosCentric.com>
156 * cdl/stdio.cdl: Fix doc link.
158 2003-02-15 Fabrice Gautier <Fabrice_Gautier@sdesigns.com>
160 * include/stdio.inl (setbuf): Don't supply size with _IONBF.
161 * src/common/stdioinlines.cxx (setbuf): Ditto.
163 2003-01-29 Jonathan Larmour <jifl@eCosCentric.com>
165 * src/output/vfnprintf.cxx: Add support for C99 'z' flag (size_t).
167 2002-09-02 Andrew Lunn <andrew.lunn@ascom.ch>
169 * include/stream.inl (set_position): Fixed typo in none buffered
170 case. Seek pos bytes, not whence bytes.
172 2002-05-17 Martin Buck <martin.buck@ascom.ch>
174 * include/stdio.h (fnprintf): Added printf-format-checking using
175 CYGBLD_ATTRIB_PRINTF_FORMAT, since gcc does it automatically only for
179 2002-04-24 Yoshinori Sato <qzb04471@nifty.ne.jp>
181 * include/streambuf.inl (Cyg_StdioStreamBuffer constructor):
182 Don't set default args in func definition.
185 2002-04-05 Jonathan Larmour <jlarmour@redhat.com>
187 * src/input/fgetc.cxx (fgetc): Silence conversion warning.
189 2002-04-04 Jonathan Larmour <jlarmour@redhat.com>
191 * src/common/fopen.cxx (fopen_inner): Allocate memory using malloc and
192 placement new, not default new.
194 * src/input/fgetc.cxx (fgetc): Don't set error on true EOF.
196 2002-04-04 Jurica Baricevic <jura@INTESIS.hr>
198 * src/common/fclose.cxx (fclose): Use delete if we can.
200 2002-02-06 Jonathan Larmour <jlarmour@redhat.com>
202 * src/input/fread.cxx (fread): when looping read into ptrc, not ptr!
204 2002-01-25 Jonathan Larmour <jlarmour@redhat.com>
206 * include/stream.inl (set_position): Fix the seek backwards case again.
209 2002-01-24 Jonathan Larmour <jlarmour@redhat.com>
211 * include/stream.inl (set_position): Fix the posdiff == 0 case.
213 2002-01-24 Jesper Skov <jskov@redhat.com>
215 * include/stream.inl (set_position): Check that posdiff is >0
216 before taking the code path that assumes so.
218 2002-01-17 Jonathan Larmour <jlarmour@redhat.com>
220 * include/stream.inl (set_position): Use an off_t for bytesavail to
223 2001-12-05 Jonathan Larmour <jlarmour@redhat.com>
225 * src/common/fflush.cxx (cyg_libc_stdio_flush_all_but): Fix starvation
226 problem when waiting for threads to unlock of lower priority.
229 2001-11-23 Jonathan Larmour <jlarmour@redhat.com>
231 * cdl/stdio.cdl: Add dependency on stdlib string conversion functions
234 2001-08-10 Robin Farine <robin.farine@terminus.org>
236 * src/output/vfnprintf.cxx (cvt): Handles the cases of finite,
237 NaN and infinite numbers separately.
239 * src/common/stream.cxx (read): Read correct number of bytes when
240 a character has been "ungot".
242 2001-08-03 Jonathan Larmour <jlarmour@redhat.com>
244 * include/streambuf.inl (~Cyg_StdioStreamBuffer): use correct configury
245 to decide when to call free.
247 2001-07-27 Jesper Skov <jskov@redhat.com>
249 * src/common/fflush.cxx (cyg_libc_stdio_flush_all_but): The check
250 for last operation being a read is only valid in buffered IO mode.
252 2001-07-20 Jonathan Larmour <jlarmour@redhat.com>
254 * include/stream.inl (set_position): Take read buffer into account
255 when seeking. Thanks to jjtsai <jjtsai@itri.org.tw> for the
258 2001-07-12 Jonathan Larmour <jlarmour@redhat.com>
260 * src/common/fflush.cxx (cyg_libc_stdio_flush_all_but): Don't
261 flush a stream that was last used for reading - it doesn't need it.
262 * include/stream.hxx: cyg_libc_stdio_flush_all_but needs to be a
263 friend of class Cyg_StdioStream to do the above.
265 2001-06-18 Jonathan Larmour <jlarmour@redhat.com>
267 * src/input/fread.cxx (fread): Fix compilation problem with below
270 2001-06-15 Rob Jansen <rwjansen@planet.nl>
272 * src/input/fread.cxx (fread): Changed to read the requested amount
273 of data items instead of stopping on CYG_LIBC_STDIO_BUFSIZE boundaries.
275 2001-06-08 Jeff Johnston <jjohnstn@redhat.com>
277 * src/input/vfscanf.cxx (vfscanf)[CYGINT_LIBC_I18N_MB_REQUIRED]: Added
278 call to mbtowc_fn for current locale to process format string.
279 Also added variable definitions needed in this circumstance.
280 * src/output/vfnprintf.cxx (vfnprintf)[CYGINT_LIBC_I18N_MB_REQUIRED]: Ditto.
281 (vfnprintf): Changed non-multibyte path to simply use the current
282 character rather than call the C mbtowc function since only
283 single byte characters would be possible.
285 2001-03-19 Jonathan Larmour <jlarmour@redhat.com>
287 * src/common/stream.cxx (refill_read_buffer): Flush all streams here...
288 (read): ...rather than here, or...
289 (read_byte): ...here.
290 This means less flushing, which improves performance.
292 * src/input/fgets.cxx: Add a reminder comment to improve this later.
293 * src/input/gets.cxx: Ditto.
296 2001-03-16 Jonathan Larmour <jlarmour@redhat.com>
298 * include/stream.hxx (class Cyg_StdioStream): Improve member visibility.
300 * src/common/stream.cxx (refill_read_buffer): Ensure eof is set.
301 * src/common/feof.cxx: New file. Implements the long lost
302 feof(), ferror() and clearerr() functions which were MIA for
304 * cdl/stdio.cdl: Build it.
306 2001-03-15 Jonathan Larmour <jlarmour@redhat.com>
308 * cdl/stdio.cdl (CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE): Default to
311 * src/input/fgets.cxx (fgets): Reimplement to work with EOF properly.
313 * src/input/gets.cxx (gets): Ditto.
315 * include/io.hxx, include/io.inl, include/stream.hxx,
316 include/stream.inl, include/streambuf.hxx, include/streambuf.inl:
317 Silence warnings from recent compilers.
319 2001-02-01 Jonathan Larmour <jlarmour@redhat.com>
321 * cdl/stdio.cdl (CYGPKG_LIBC_STDIO_OPEN): Implements
322 CYGINT_ISO_STDIO_POSIX_FDFUNCS ( fileno() and fdopen() ).
324 2000-11-01 Jonathan Larmour <jlarmour@redhat.com>
326 * include/stdio.h: Make FILE array type larger to be more resistant
327 against small data sections.
328 Lose the cyg_libc_stdio_stdin/out/err definitions with macros for
329 stdin/stdout/err since it can cause problems with libgcc exception
330 code. Instead just make these extern FILE *s.
331 * src/common/stderr.cxx:
332 * src/common/stdin.cxx:
333 * src/common/stdout.cxx:
334 Define objects with init priority corresponding to order the fd's
335 should be allocated where applicable.
336 Define actual stdin, stdout, stderr externally visible constants to
337 point to the streams.
339 * cdl/stdio.cdl: Support CYGINT_ISO_STDIO_STREAMS interface
341 * src/common/fopen.cxx (fdopen): return f as intended
343 2000-10-23 Jesper Skov <jskov@redhat.com>
345 * include/streambuf.inl: Adjust assertions to cope with buffers
346 generated by sprintf and similar non-bound-buffer calls.
348 2000-08-09 Jonathan Larmour <jlarmour@redhat.co.uk>
350 * include/io.inl: No need to include string.h
352 * cdl/stdio.cdl: Add some more requires statements
354 2000-08-07 Jonathan Larmour <jlarmour@redhat.co.uk>
356 * src/common/stream.cxx (Cyg_StdioStream::Cyg_StdioStream):
357 Only call io_buf members conditionally.
359 2000-08-03 Jonathan Larmour <jlarmour@redhat.co.uk>
361 * src/common/fseek.cxx: Include assertion and tracing support since
364 2000-07-20 Nick Garnett <nickg@cygnus.co.uk>
366 * include/stream.hxx (class Cyg_StdioStream): Added get_dev()
367 accessor member function to return underlying device handle.
369 * src/common/fopen.cxx: Added fdopen() and fileno(). Reorganized
370 fopen() so that code common with fdopen() is now in a separate
373 * src/common/stdiosupp.cxx (Cyg_libc_stdio_find_filename): Removed
376 2000-07-13 Nick Garnett <nickg@cygnus.co.uk>
378 * cdl/stdio.cdl: Added common/fseek.cxx to compile list.
379 Reorganized options for stream buffering:
380 CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF now controls whether the user
381 can attach their own buffer to the stream.
382 CYGSEM_LIBC_STDIO_SETVBUF_MALLOC controls whether buffers can be
383 malloced or only statically defined.
384 Added CYGPKG_LIBC_STDIO_FILEIO option to control whether the STDIO
385 package uses the FILEIO package for all IO, or goes directly to
386 the device drivers as before.
388 * include/stdio.h: Added file positioning calls defined in section
389 7.9.9 of the standard.
393 Added these files to define an abstraction layer for access to the
394 real device underlying an IO stream. Depending on
395 CYGPKG_LIBC_STDIO_FILEIO this either goes to the FILEIO package or
396 directly to the device drivers.
398 * include/stream.hxx:
399 Modifications to use io.hxx abstractions.
400 Added second constructor for creating a buffer-only stream.
401 Added initialize() function which contains most of the common
402 stream initialization code.
403 Added a close() member function.
405 * include/stream.inl:
406 Modifications to use io.hxx abstractions.
407 Moved most of the work of the destructor into close() member.
408 Added FILEIO version of set_position() member function.
410 * include/streambuf.hxx:
411 * include/streambuf.inl:
412 * src/common/streambuf.cxx:
413 Rearranged to match new buffering configuration options.
415 * src/common/stream.cxx:
416 Modifications to use io.hxx abstractions.
417 Added second constructor, and moved common initialization code to
418 initialize() member function.
419 Added code to make position member correctly track current file
422 * src/common/fopen.cxx:
423 Fixed handling of write/append in process_mode().
424 Moved call of process_mode() to before call to cyg_stdio_open() so
425 that stream modes may be passed in.
426 Added code to detect an interactive stream and choose non-buffered
427 mode - fully buffered is now the default.
428 Added calls to cyg_stdio_close() where appropriate.
430 * src/output/vfnprintf.cxx: Removed FLUSH() macro and its
431 uses. Deciding to flush should be in the hands of the buffer code,
432 or the user calling fflush().
434 * src/common/vsscanf.cxx:
435 Added FILEIO variant of vsscanf(). This uses a precharged stream
436 object to emulate input.
438 * src/common/vsnprintf.cxx:
439 Added FILEIO variant of vsnprintf(). This uses the standard stream
440 object to print into the supplied buffer.
442 * src/common/fseek.cxx:
443 Added this file to implement file positioning functions.
445 * src/common/fclose.cxx (fclose):
446 Added call to Cyg_StdioStream::close().
448 * include/stdiosupp.hxx:
449 * src/common/stdiosupp.cxx:
450 Modified Cyg_libc_stdio_find_filename() to take mode, binary and
453 * src/common/stdin.cxx:
454 * src/common/stdout.cxx:
455 * src/common/stderr.cxx:
456 Modified calls to Cyg_libc_stdio_find_filename() to pass
457 appropriate values for mode, binary and append arguments.
459 2000-06-18 Jonathan Larmour <jlarmour@redhat.co.uk>
461 * src/common/vsscanf.cxx: Add NULL select entry to DEVIO_TABLE
462 * src/common/vsnprintf.cxx: Likewise
464 2000-05-25 Hugo Tyson <hmt@cygnus.co.uk>
466 * include/stream.inl (set_error): If the error is EEOF, set
467 the EOF flag (flags.at_eof) so that clients know.
469 * src/input/fgetc.cxx (__fgetc):
470 * src/input/fgets.cxx (_fgets):
471 * src/input/fread.cxx (_fread): Correctly handle an error,
472 or EOF indication, from real_stream->refill_read_buffer().
474 2000-05-02 Jonathan Larmour <jlarmour@redhat.co.uk>
477 Separated original libc out into separate packages on functional
479 Header files are now managed by isoinfra package
480 Plenty of cleanups done, but no major functionality changes
482 //===========================================================================
483 //####ECOSGPLCOPYRIGHTBEGIN####
484 // -------------------------------------------
485 // This file is part of eCos, the Embedded Configurable Operating System.
486 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
487 // Copyright (C) 2004 eCosCentric Limited
489 // eCos is free software; you can redistribute it and/or modify it under
490 // the terms of the GNU General Public License as published by the Free
491 // Software Foundation; either version 2 or (at your option) any later version.
493 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
494 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
495 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
498 // You should have received a copy of the GNU General Public License along
499 // with eCos; if not, write to the Free Software Foundation, Inc.,
500 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
502 // As a special exception, if other files instantiate templates or use macros
503 // or inline functions from this file, or you compile this file and link it
504 // with other works to produce a work based on this file, this file does not
505 // by itself cause the resulting work to be covered by the GNU General Public
506 // License. However the source code for this file must still be made available
507 // in accordance with section (3) of the GNU General Public License.
509 // This exception does not invalidate any other reasons why a work based on
510 // this file might be covered by the GNU General Public License.
512 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
513 // at http://sources.redhat.com/ecos/ecos-license/
514 // -------------------------------------------
515 //####ECOSGPLCOPYRIGHTEND####
516 //===========================================================================