Commit Graph

47 Commits

Author SHA1 Message Date
Eric Blake 08146e5adb Fix fflush issues.
* libc/stdio/fflush.c (_fflush_r): New function.
(fflush): Fix reentrancy and large offset behavior.
* libc/include/stdio.h (_fflush_r): Add prototype.
* libc/stdio/fclose.c (_fclose_r): All fflush callers changed.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/fseek.c (_fseek_r): Likewise.
* libc/stdio/ftell.c (_ftell_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Likewise.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/setvbuf.c (setvbuf): Likewise.
* libc/stdio/ungetc.c (_ungetc_r): Likewise.
* libc/stdio/vfprintf.c (__sbprintf): Likewise.
* libc/stdio/wbuf.c (__swbuf_r): Likewise.
* libc/stdio64/freopen64.c (_freopen64_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise.  Defer to
32-bit version if not large file.
* libc/stdio64/ftello64.c (_ftello64_r): Likewise.
* libc/stdio64/tmpfile64.c (_tmpfile64_r): Avoid compile warning.
2007-07-13 20:37:53 +00:00
Eric Blake 17c61d6a2c Implement funopen, fopencookie.
* libc/include/sys/reent.h (struct __sFILE, struct __sFILE64):
Switch to reentrant callbacks.
* libc/include/stdio.h (funopen): Fix declaration.
(fopencookie): Declare.
* libc/stdio/local.h (__sread, __swrite, __sseek, __sclose)
(__sseek64, __swrite64): Fix prototypes.
[__SCLE]: Pull in setmode declaration.
* libc/stdio/stdio.c (__sread, __swrite, __sseek, __sclose): Fix
reentrancy.
* libc/stdio64/stdio64.c (__sseek64_r, __swrite64_r): Delete.
(__sseek64, __swrite64): Fix reentrancy.
* libc/stdio/fseek.c (_fseek_r): Account for overflow, and fix
reentrancy.
* libc/stdio/ftell.c (_ftell_r): Likewise.
* libc/stdio/flags.c (__sflags): Don't lose __SAPP on "a+".
* libc/stdio/fclose.c (_fclose_r): Fix reentrancy.
* libc/stdio/freopen.c (_freopen_r): Likewise.
* libc/stdio/fvwrite.c (__sfvwrite_r): Likewise.
* libc/stdio/refill.c (__srefill_r): Likewise.
* libc/stdio/siscanf.c (eofread): Likewise.
* libc/stdio/sscanf.c (eofread): Likewise.
* libc/stdio/vsiscanf.c (eofread1): Likewise.
* libc/stdio/vsscanf.c (eofread1): Likewise.
* libc/stdio64/freopen64.c (_freopen64_r): Likewise.
* libc/stdio64/fseeko64.c (_fseeko64_r): Likewise.
* libc/stdio64/ftello64.c (_ftello64_r): Likewise.
* libc/stdio/fflush.c (fflush): Improve reentrancy, although more
could be fixed.
* libc/stdio/fopencookie.c (_fopencookie_r, fopencookie): New file.
* libc/stdio/funopen.c (_funopen_r, funopen): New file.
* libc/stdio/Makefile.am (ELIX_4_SOURCES, CHEWOUT_FILES): Build
new files.
* libc/stdio/Makefile.in: Regenerate.
2007-06-04 18:10:17 +00:00
Eric Blake b9db529222 Add support for asnprintf, and improve *printf documentation.
* libc/stdio/Makefile.am (ELIX_SOURCES): Rename...
	(ELIX_2_SOURCES): ...to this.
	(ELIX_4_SOURCES): Add new variable.  Build asnprintf.
	(GENERAL_SOURCES): Move dprintf to ELIX_4_SOURCES.
	(CHEWOUT_FILES): Include diprintf in documentation.
	* libc/stdio/Makefile.in: Regenerate.
	* libc/stdio/diprintf.c: Improve documentation.
	* libc/stdio/dprintf.c: Likewise.
	* libc/stdio/siprintf.c: Likewise.
	* libc/stdio/sprintf.c: Likewise.
	* libc/stdio/vfprintf.c: Likewise.
	* libc/stdio/viprintf.c: Likewise.
	* libc/stdio/vsniprintf.c: Consolidate documentation.
	* libc/stdio/asiprintf.c: Refer to documentation.
	* libc/stdio/asprintf.c: Likewise.
	* libc/stdio/fiprintf.c: Likewise.
	* libc/stdio/fprintf.c: Likewise.
	* libc/stdio/iprintf.c: Likewise.
	* libc/stdio/printf.c: Likewise.
	* libc/stdio/sniprintf.c: Likewise.
	* libc/stdio/vdiprintf.c: Likewise.
	* libc/stdio/vdprintf.c: Likewise.
	* libc/stdio/vsiprintf.c: Likewise.
	* libc/stdio/fvwrite.c (__sfvwrite_r): Handle asnprintf.
	* libc/stdio/asniprintf.c (asniprintf, _asniprintf_r): New file.
	* libc/stdio/asnprintf.c (asnprintf, _asnprintf_r): New file.
	* libc/stdio/vasniprintf.c (vasniprintf, _vasniprintf_r): New
	file.
	* libc/stdio/vasnprintf.c (vasnprintf, _vasnprintf_r): New file.
	* libc/stdio/vdprintf.c (_vdprintf_r): Rewrite to avoid malloc in
	typical case.
	* libc/stdio/vdiprintf.c (_vdiprintf_r): Likewise.
	* libc/include/stdio.h: Add prototypes for new functions; sort
	existing functions.
2007-05-04 02:55:16 +00:00
Eric Blake 503e2d1c76 * libc/include/stdio.h (_ELIDABLE_INLINE): Work even when using
CFLAGS=-O0.
2007-04-10 12:49:18 +00:00
Eric Blake 17c0c97d7c * libc/include/stdio.h: Add gcc format attributes to printf and
scanf families.
2007-04-10 12:47:13 +00:00
Jeff Johnston db7aa4b168 2007-04-04 Eric Blake <ebb9@byu.net>
* libc/stdio/asiprintf.c (_asiprintf_r): Fix reentrancy.
	(asiprintf): Avoid overhead.
	* libc/stdio/asprintf.c (_asprintf_r): Fix reentrancy.
	(asprintf): Avoid overhead.
	* libc/stdio/diprintf.c (_diprintf_r, diprintf): New file.
	* libc/stdio/dprintf.c (_dprintf_r, dprintf): Use _DEFUN.
	* libc/stdio/fiprintf.c (_fiprintf_r): Add reentrant version.
	(fiprintf): Avoid overhead.
	* libc/stdio/fprintf.c (_fprintf_r): Add reentrant version.
	(fprintf): Avoid overhead.
	* libc/stdio/iprintf.c (_iprintf_r): Use _DEFUN.
	(iprintf): Avoid overhead.
	* libc/stdio/printf.c (_printf_r): Use _DEFUN.
	(printf): Avoid overhead.
	* libc/stdio/vasiprintf.c (vasiprintf): Reduce binary size.
	* libc/stdio/vasprintf.c (vasprintf): Reduce binary size.
	* libc/stdio/vdiprintf.c (_vdiprintf_r, vdiprintf): New file.
	* libc/stdio/vdprintf.c (vdprintf): Avoid overhead.
	* libc/stdio/vsiprintf.c (vsiprintf): Reduce binary size.
	* libc/stdio/vsniprintf.c (vsniprintf): Reduce binary size.
	* libc/stdio/vsnprintf.c (vsnprintf): Reduce binary size.
	* libc/stdio/vsprintf.c (vsprintf): Reduce binary size.
	* libc/stdio/Makefile.am (GENERAL_SOURCES): Add diprintf.c,
	vdiprintf.c.
	* libc/include/stdio.h (diprintf, _diprintf_r, vdiprintf)
	(_vdiprintf_r, _fiprintf_r, _vfiprintf_r): Add prototypes.
2007-04-04 18:32:49 +00:00
Dave Korn 2c58b5a5e8 2007-03-30 Dave Korn <dave.korn@artimi.com>
* libc/include/stdio.h (_ELIDABLE_INLINE):  New macro to conceal
	conflicting inline semantics between C99 and GNU89.
	(__sgetc_r):  Replace static inline with _ELIDABLE_INLINE to be
	compatible with -fkeep-inline-functions usage.
	(__sputc_r):  Likewise for consistency even though disabled.
2007-03-30 00:49:56 +00:00
Jeff Johnston 960e5d8f19 2007-02-20 Kazunori Asayama <asayama@sm.sony.co.jp>
* libc/include/stdio.h: Add declaration for vsiprintf.
2007-02-20 20:53:35 +00:00
Jeff Johnston 7d592bb178 2007-02-01 Joel Schopp <jschopp@austin.ibm.com>
Kazunori Asayama <asayama@sm.sony.co.jp>

        * configure.host: Enable SPU specific stdio directory.
        * libc/machine/spu/Makefile.am: Add objects.
        * libc/machine/spu/Makefile.in: Regenerated.
        * libc/machine/spu/c99ppe.h: Add macros and function
        declarations to initialize SPU specific stdio stuffs.
        * libc/machine/spu/stdio.c: Add functions to manage Cell SPU
        specific FILE structures.
        * libc/machine/spu/perror.c: Add initialization routine of
        stdio stuffs.
        * libc/machine/spu/printf.c: Ditto.
        * libc/machine/spu/putchar.c: Ditto.
        * libc/machine/spu/puts.c: Ditto.
        * libc/machine/spu/vprintf.c: Ditto.
        * libc/machine/spu/clearerr.c: New file. Add a stdio function
        implementation.
        * libc/machine/spu/feof.c: Ditto.
        * libc/machine/spu/ferror.c: Ditto.
        * libc/machine/spu/fileno.c: Ditto.
        * libc/machine/spu/fopen.c: Ditto.
        * libc/machine/spu/fclose.c: Ditto.
        * libc/machine/spu/freopen.c: Ditto.
        * libc/machine/spu/fflush.c: Ditto.
        * libc/machine/spu/fseek.c: Ditto.
        * libc/machine/spu/ftell.c: Ditto.
        * libc/machine/spu/rewind.c: Ditto.
        * libc/machine/spu/fgetpos.c: Ditto.
        * libc/machine/spu/fsetpos.c: Ditto.
        * libc/machine/spu/fread.c: Ditto.
        * libc/machine/spu/fwrite.c: Ditto.
        * libc/machine/spu/getc.c: Ditto.
        * libc/machine/spu/getchar.c: Ditto.
        * libc/machine/spu/gets.c: Ditto.
        * libc/machine/spu/fgetc.c: Ditto.
        * libc/machine/spu/fgets.c: Ditto.
        * libc/machine/spu/ungetc.c: Ditto.
        * libc/machine/spu/putc.c: Ditto.
        * libc/machine/spu/fputc.c: Ditto.
        * libc/machine/spu/fputs.c: Ditto.
        * libc/machine/spu/vfprintf.c: Ditto.
        * libc/machine/spu/vfscanf.c: Ditto.
        * libc/machine/spu/fprintf.c: Ditto.
        * libc/machine/spu/fscanf.c: Ditto.
        * libc/machine/spu/scanf.c: Ditto.
        * libc/machine/spu/vscanf.c: Ditto.
        * libc/machine/spu/setbuf.c: Ditto.
        * libc/machine/spu/setvbuf.c: Ditto.
        * libc/machine/spu/tmpfile.c: Ditto.

2007-02-01  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/include/sys/config.h[__SPU__]: Define __CUSTOM_FILE_IO__.
        * libc/include/stdio.h[!__CUSTOM_FILE_IO__]: Add flag check
        around stdio macros that manipulate fields in the normal file
        structure.
        * libc/include/sys/reent.h[__CUSTOM_FILE_IO__]: Include
        <sys/custom_file.h> to define custom FILE structure.
        * libc/include/sys/custom_file.h: New default header file
        that generates error if not overridden when __CUSTOM_FILE_IO__ set.
        * libc/machine/spu/sys/custom_file.h: New file.
2007-02-01 16:33:05 +00:00
Jeff Johnston e5e148d15b 2006-09-26 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h[_REENT_SMALL]: Do not allow macros
        for clearerr, feof, or fileno.
        * libc/include/sys/reent.h[_REENT_SMALL](struct _reent): Change
        the dummy std stream scheme to use pointers to const external
        fake files, one for each standard stream.
        * libc/stdio/local.h (CHECK_INIT): Change to take a file pointer
        argument.  For _REENT_SMALL, reset the file pointer if it
        matches one of the fake std stream pointers.
        * libc/stdio/clearerr.c: Fix CHECK_INIT macro to add file pointer
        argument.
        * libc/stdio/fclose.c: Ditto.
        * libc/stdio/feof.c: Ditto.
        * libc/stdio/ferror.c: Ditto.
        * libc/stdio/fflush.c: Ditto.
        * libc/stdio/fgetc.c: Ditto.
        * libc/stdio/fgets.c: Ditto.
        * libc/stdio/fileno.c: Ditto.
        * libc/stdio/findfp.c: Ditto.
        * libc/stdio/fputc.c: Ditto.
        * libc/stdio/fputs.c: Ditto.
        * libc/stdio/fread.c: Ditto.
        * libc/stdio/freopen.c: Ditto.
        * libc/stdio/fseek.c: Ditto.
        * libc/stdio/ftell.c: Ditto.
        * libc/stdio/fwrite.c: Ditto.
        * libc/stdio/getc.c: Ditto.
        * libc/stdio/getdelim.c: Ditto.
        * libc/stdio/putc.c: Ditto.
        * libc/stdio/refill.c: Ditto.
        * libc/stdio/setvbuf.c: Ditto.
        * libc/stdio/ungetc.c: Ditto.
        * libc/stdio/vfprintf.c: Ditto.
        * libc/stdio/vfscanf.c: Ditto.
        * libc/stdio/wbuf.c: Ditto.: Ditto.
        * libc/stdio/wsetup.c: Ditto.
        * libc/stdio64/freopen64.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/stdio64/ftello64.c: Ditto.
        * libc/machine/powerpc/vfprintf.c: Ditto.
        * libc/machine/powerpc/vfscanf.c: Ditto.
2006-09-26 21:22:19 +00:00
Jeff Johnston c8956c6fec 2006-06-15 Corinna Vinschen <corinna@vinschen.de>
* libc/include/stdio.h (__sgetc_r): Fix typo.
        * libc/stdio/fread.c (_fread_r): Convert crlf calls to crlf_r.
        * libc/stdio/rget.c (__srbuf): Reinstantiate.
        * libc/stdio/wbuf.c (__swbuf): Ditto.
2006-06-15 16:08:09 +00:00
Jeff Johnston 4dc0c0c4e5 2006-06-14 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new reentrant I/O prototypes for
        read/write functions.  Change getc/putc macros to have reentrant underlying
        macros/functions.  This includes __sgetc_raw_r, __sgetc_r, and __sputc_r.
        * libc/stdio/fgetc.c: Fix and/or add reentrant version to call
        new reentrant I/O functions/macros for reading/writing.
        * libc/stdio/fgets.c: Ditto.
        * libc/stdio/fputc.c: Ditto.
        * libc/stdio/fputs.c: Ditto.
        * libc/stdio/fread.c: Ditto.
        * libc/stdio/fseek.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/stdio/fwrite.c: Ditto.
        * libc/stdio/getc.c: Ditto.
        * libc/stdio/getc_u.c: Ditto.
        * libc/stdio/getchar.c: Ditto.
        * libc/stdio/getchar_u.c: Ditto.
        * libc/stdio/putc.c: Ditto.
        * libc/stdio/putc_u.c: Ditto.
        * libc/stdio/putchar.c: Ditto.
        * libc/stdio/puts.c: Ditto.
        * libc/stdio/vfprintf.c: Ditto.
        * libc/stdio/vfscanf.c: Ditto.
        * libc/stdio/fvwrite.c: Change __sfvwrite into reentrant __sfvwrite_r.
        Change all previous callers of __sfvwrite.  Set errno to EBADF and
        set error flag on if attempt is made to write to file that does not
        allow writing.
        * libc/stdio/fvwrite.h: Fix new reentrant prototypes.
        * libc/stdio/local.h: Ditto.
        * libc/stdio/refill.c: Turn __srefill into reentrant __srefill_r.
        Set errno to EBADF and the error flag on if attempt is made to
        read unreadable file.  Change all previous callers of __srefill.
        * libc/stdio/rget.c
        * libc/stdio/wbuf.c: Turn __swbuf into reentrant __swbuf_r.  Change
        all previous callers of __swbuf.
        * libc/sys/linux/machine/i386/huge_val.h: Ifdef out file contents since
        huge value macros are already defined correctly for i386 by <math.h>.
2006-06-14 20:49:11 +00:00
Jeff Johnston 8eeee74e95 2006-05-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Protect dprintf prototype
        with #ifndef dprintf so as to not interfere with
        historical code defining their own dprintf macro.
2006-05-23 19:57:31 +00:00
Jeff Johnston dc7798c6b0 2006-05-18 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add prototypes for fiscanf,
        iscanf, and siscanf.
2006-05-18 18:07:19 +00:00
Jeff Johnston 339195bf12 2005-10-11 Shaun Jackman <sjackman@gmail.com>
* libc/include/stdio.h (dprintf): New declaration.
        (vdprintf): Ditto.
        * libc/stdio/Makefile.am (GENERAL_SOURCES): Add dprintf.c
        and vdprintf.c.
        * libc/stdio/Makefile.in: Regenerate.
        * libc/stdio/dprintf.c: New file.
        * libc/stdio/vdprintf.c: New file.
        * libc/stdio/stdio.tex (dprintf): New entry.
2005-10-11 23:59:32 +00:00
Jeff Johnston 8f36ef2f33 2005-09-02 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add prototype for viprintf.
2005-09-02 15:39:29 +00:00
Jeff Johnston 3bf091476a 2004-11-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new iprintf and iscanf variants.  Also
        do some reordering.
        * libc/machine/powerpc/vfscanf.c: Remove __sccl function.
        * libc/stdio/Makefile.am: Add support for new iprintf and iscanf
        family functions.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/fiprintf.c: Remove doc to siprintf.c.
        * libc/stdio/iprintf.c: Ditto.
        * libc/stdio/local.h (__svfiscanf_r): New prototype.
        * libc/stdio/siprintf.c: Add docs for various iprintf family functions.
        * libc/stdio/sniprintf.c: Move docs to siprintf.c.
        * libc/stdio/stdio.tex: Add new functions.
        * libc/stdio/vfscanf.c: Split out __sccl function to separate
        file and add special name defines so this file can be used
        to build vfiscanf.o.
        * libc/stdio/asiprintf.c: New file.
        * libc/stdio/fiscanf.c: Ditto.
        * libc/stdio/iscanf.c: Ditto.
        * libc/stdio/sccl.c: Ditto.
        * libc/stdio/siscanf.c: Ditto.
        * libc/stdio/vasiprintf.c: Ditto.
        * libc/stdio/viprintf.c: Ditto.
        * libc/stdio/viscanf.c: Ditto.
        * libc/stdio/vsiprintf.c: Ditto.
        * libc/stdio/vsiscanf.c: Ditto.
        * libc/stdio/vsniprintf.c: Ditto.
2004-11-24 00:45:41 +00:00
Jeff Johnston 0f0fcb042a 2004-11-19 Shaun Jackman <sjackman@gmail.com>
* libc/include/stdio.h: Add sniprintf.
        * libc/stdio/Makefile.am: Add sniprintf.c.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/sniprintf.c: New file.
        * libc/stdio/stdio.tex: Add sniprintf.
2004-11-20 01:42:35 +00:00
Jeff Johnston 186420eccf 2004-05-07 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/iprintf.c (_iprintf_r): Fix old-style argument
        list for reentrant pointer.  Call _vfiprintf_r.
        * libc/stdio/siprintf.c (_siprintf_r): New function.
        * libc/stdio/vfprintf.c (__sbprintf): Add reetrant struct
        pointer argument.  Change all callers.  Call _VFPRINTF_R.
        * libc/include/stdio.h (_siprintf_r, _vfiprintf_r): New
        prototypes.
2004-05-07 21:00:41 +00:00
Jeff Johnston 20b0251ab3 2004-05-03 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/include/stdio.h (_ungetc_r): New prototype.
        * libc/stdio/ungetc.c (_ungetc_r): New reentrant function.
        (__submore): Add reentrant struct pointer argument.
        (ungetc): Change to call _ungetc_r.
2004-05-03 17:27:56 +00:00
Jeff Johnston c00f971933 2004-04-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: (_ftell_r, _fseek_r): New prototypes.
2004-04-23 20:06:03 +00:00
Jeff Johnston 47dcaf565d 2004-04-08 Artem B. Bityuckiy <abitytsky@softminecorp.com>
* libc/stdio/fclose.c (_fclose_r): New function.
        * libc/stdio/freopen.c (_freopen_r): Call _fclose_r.
        * libc/stdio/fcloseall.c (_fcloseall_r): Call _fwalk_reent.
        * libc/stdio64/freopen64.c (_freopen64_r): Use _fclose_r.
        * libc/include/stdio.h (_fclose_r): New prototype.
        * libc/stdio/fopen.c: Fix typo in comment.

2004-04-08  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/stdio/fwalk.c (_fwalk_reent): New version of _fwalk
        to handle _r reentrant functions.
2004-04-08 22:26:50 +00:00
Jeff Johnston 0eca075074 2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Allow the io64 function prototypes for
        Cygwin when compiling newlib.
        * libc/include/sys/stat.h[__CYGWIN__]: Define stat64 as __stat64
        to expose the Cygwin struct __stat64 type.
        * libc/stdio64/fseeko64.c: Use _fstat64_r and pass a struct stat64
        pointer.
        * libc/stdio64/tmpfile64.c(_tmpfile64_r): Call _fopen64_r.
2003-08-26 18:09:43 +00:00
Christopher Faylor 035367578f * libc/stdio64/fdopen64.c: New file.
* libc/stdio64/Makefile.am (LIB_OBJS): Add fdopen64.o
* libc/stdio64/Makefile.in: Regenerate.
* libc/include/stdio.h (fdopen64): Define.
* libc/include/stdio.h (_fdopen64_r): Ditto.
2003-07-25 16:06:01 +00:00
Corinna Vinschen 8a4b4764b8 * libc/ctype/ctype_.c: Remove checks for deprecated __CYGWIN32__.
* libc/include/stdio.h: Ditto.
	* libc/include/sys/config.h: Ditto.
	* libc/stdio/mktemp.c: Ditto.
2003-05-13 09:46:48 +00:00
Corinna Vinschen b47fcdf03d * libc/include/stdio.h: Change one __CYGWIN__ to __CYGWIN32__. 2003-05-12 11:26:11 +00:00
Corinna Vinschen 2a940c1a22 * libc/include/stdio.h: Declare fgetpos, fsetpos, fseeko and ftello
with internal (_fpos_t and _off_t) datatypes when compiling newlib.
	* libc/include/sys/unistd.h: Declare _lseek using _off_t.
	* libc/reent/lseekr.c (_lseek_r): Use _off_t instead of off_t.
	* libc/stdio/fseeko.c (fseeko): Ditto.
	* libc/stdio/ftello.c (ftello): Ditto.
	* libc/stdio/stdio.c (__swrite): Ditto.
	(__sseek): Ditto.
	* libc/stdio/fgetpos.c (fgetpos): Use _fpos_t instead of fpos_t.
	* libc/stdio/fseek.c (fseek): Ditto.
	* libc/stdio/fsetpos.c (fsetpos): Ditto.
	* libc/stdio/ftell.c (ftell): Ditto.
	* libc/stdio/local.h: Declare __sseek using _off_t.
2003-03-14 18:39:05 +00:00
Corinna Vinschen 5582abd2c7 * configure.host: Define stdio64_dir for Cygwin.
* libc/include/stdio.h: Change definition of fpos_t to fulfill
	Cygwin 64bit file access requirements.
	Drop definition of f*64() functions when compiled for Cygwin.
	* libc/include/sys/config.h: Define __LARGE64_FILES for Cygwin.
	* libc/reent/lseek64r.c: Use _off64_t instead of off64_t.
	* libc/stdio64/local64.h: Use _fpos64_t instead of fpos64_t.
2003-03-07 20:41:49 +00:00
Jeff Johnston bc10065533 2002-07-23 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Move fcloseall prototype within
        #ifndef _REENT_ONLY section.
        * libc/sys/linux/Makefile.am: Add new files.
        * libc/sys/linux/Makefile.in: Regenerated.
        * libc/sys/linux/sys/stdio.h: Add ctermid prototype.
        * libc/sys/linux/sys/unistd.h: Add ttyname_r prototype.
        * libc/sys/linux/sys/types.h: Add ino64_t type.
        * libc/sys/linux/ctermid.c: New file.
        * libc/sys/linux/ttyname_r.c: Ditto.
        * libc/sys/linux/readdir64.c: Ditto.
2002-07-23 19:40:45 +00:00
Jeff Johnston f5f27f0778 2002-07-22 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h (fcloseall, _fcloseall_r): Added prototypes.
        * libc/stdio/Makefile.am: Added fcloseall.c support.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/fcloseall.c: New file.
        * libc/stdio64/Makefile.am: Remove missing .def references.
        * libc/stdio64/Makefile.in: Regenerated.
2002-07-22 23:53:50 +00:00
Jeff Johnston dee5139131 2002-07-17 Jeff Johnston <jjohnstn@redhat.com>
* configure.host(stdio64_dir): New setting that is used to
        enable building of new stdio64 directory.
        * libc/Makefile.am[HAVE_STDIO64_DIR]: Add support for
        large files.
        (stmp-stdio64,stdio64.texi): New targets to optionally add in
        stdio64 info to info files.
        * libc/Makefile.in: Regenerated.
        * libc/configure: Ditto.
        * libc/configure.in: Add configuration variables that are set
        when stdio64 is selected as subdir in configure.host.
        * libc/libc.texinfo: Add optional menu item for Stdio64, based
        on whether STDIO64 flag is set or not.
        * libc/sys.tex: Add optional stdio64 syscalls based on whether
        STDIO64 flag is set or not.
        * libc/include/reent.h[__LARGE64_FILES]: Add new stdio64
        _r sycall routines.
        * libc/include/stdio.h[__LARGE64_FILES]: Add new stdio64 prototypes.
        (FILE): Typedef'd to __FILE instead of struct __sFILE directly.
        (__SL64): New file flag indicating file is opened via fopen64.
        * libc/include/sys/_types.h(_off64_t): Added.
        * libc/include/sys/config.h: For x86-linux, define __LARGE64_FILES.
        * libc/include/sys/reent.h(struct __sFILE64): New file structure
        for 64-bit offset large file support.
        (__FILE): New intermediate type either set to struct __sFILE64 or
        struct __sFILE, depending on whether __LARGE64_FILES is set or not.
        * libc/reent/Makefile.am[HAVE_STDIO64_DIR]: Add new files.
        * libc/reent/Makefile.in: Regenerated.
        * libc/reent/fstat64r.c: New file.
        * libc/reent/lseek64r.c: Ditto.
        * libc/reent/open64r.c: Ditto.
        * libc/reent/reent.tex: Optionally add stdio64 reentrant syscalls
        based on whether STDIO64 flag is set.
        * libc/stdio/stdio.tex: Add blank line.
        * libc/stdio64/Makefile.am: New file.
        * libc/stdio64/Makefile.in: Ditto.
        * libc/stdio64/fgetpos64.c: Ditto.
        * libc/stdio64/fopen64.: Ditto.
        * libc/stdio64/freopen64.c: Ditto.
        * libc/stdio64/fseeko64.c: Ditto.
        * libc/stdio64/fsetpos64.c: Ditto.
        * libc/stdio64/ftello64.c: Ditto.
        * libc/stdio64/local64.h: Ditto.
        * libc/stdio64/stdio64.c: Ditto.
        * libc/stdio64/stdio64.tex: Ditto.
        * libc/stdio64/tmpfile64.c: Ditto.
        * libc/sys/linux/io64.c: Add weak aliases for lseek64, fstat64, and
        open64.
2002-07-17 23:25:44 +00:00
Jeff Johnston 30b2092fcb 2002-07-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new prototypes.
        * libc/stdio/Makefile.am: Add fseeko.c and ftello.c.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/fseek.c: Add fseeko documentation.
        * libc/stdio/ftell.c: Add ftello documentation.
        * libc/stdio/fseeko.c: New file.
        * libc/stdio/ftello.c: New file.
2002-07-04 19:33:54 +00:00
Jeff Johnston 7501704dc9 2002-07-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/Makefile.am: Add asprintf.c and vasprintf.c.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/asprintf.c: New file.
        * libc/stdio/vasprintf.c: Ditto.
        * libc/stdio/fvwrite.c: Add code to dynamically reallocate
        the buffer for asprintf support.
        * libc/stdio/sprintf.c: Add asprintf documentation.
        * libc/stdio/vfprintf.c: Add vasprintf documentation.
        * libc/include/stdio.h: Add new prototypes.
2002-07-04 18:56:17 +00:00
Jeff Johnston c1a3171f2d 2002-06-27 Benjamin Kosnik <bkoz@redhat.com>
* libc/include/stdio.h: Untangle, add _BEGIN_STD_C and _END_STD_C.
        * libc/include/time.h: Same.
        * libc/include/string.h: Same.
        * libc/include/stdlib.h: Same.
        * libc/include/signal.h: Same.
        * libc/include/setjmp.h: Same.
        * libc/include/math.h: Same.
        * libc/include/locale.h: Same.
        * libc/include/ctype.h: Same.
        * libc/include/machine/setjmp.h: Same.
        * libc/include/_ansi.h (_BEGIN_STD_C): Add.
        (_END_STD_C): Add.
2002-06-27 23:58:38 +00:00
Jeff Johnston d427d09204 2002-06-21 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h (__getline, __getdelim): New prototypes.
        * libc/include/time.h [HAVE_GETDATE](getdate, getdate_r): Ditto.
        [HAVE_GETDATE](getdate_err): New error code.
        * libc/stdio/Makefile.am: Add support for getline.c and getdelim.c.
        * libc/stdio/Makefile.in: Regenerated.
        * libc/stdio/getdelim.c: New file.
        * libc/stdio/getline.c: Ditto.
        * libc/sys/linux/Makefile.am: Add support for getdate.c, getdate_err.c
        and ntp_gettime.c.  Also add AM_CFLAGS to point to libc/stdio.
        * libc/sys/linux/Makefile.in: Regenerated.
        * libc/sys/linux/getdate.c: New file.
        * libc/sys/linux/getdate_err.c: Ditto.
        * libc/sys/linux/ntp_gettime.c: Ditto.
        * libc/sys/linux/time.c (adjtimex, ntp_adjtime): New functions.
        * libc/sys/linux/sys/stdio.h (getline, getdelim): New macros.
2002-06-21 18:29:23 +00:00
Jeff Johnston 5e2cbfb6e8 2002-05-17 Jeff Johnston <jjohnstn@redhat.com>
* Makefile.am: Copy and install headers from sys/machine/include
	directory.  Also pass $toollibdir to lower-level directories.
	* Makefile.in: Regenerated.
	* libc/include/stdio.h[!_REENT_ONLY]: Change stdin, stdout, and
	stderr to use _REENT macro instead of _impure_ptr directly.
	* libc/include/sys/config.h[__i386__][__linux__]: Define
	__DYNAMIC_REENT__.
	* libc/include/sys/reent.h[!_REENT_ONLY]: Change _REENT macro to be
	call to __getreent() function if !__SINGLE_THREAD__ and
	__DYNAMIC_REENT__ is set.
	* libc/reent/Makefile.am: Add support for getreent.c.
	* libc/reent/Makefile.in: Regenerated.
	* libc/string/strerror.c: Add check if EOPNOTSUPP and ENOTSUP are same.
	* libc/sys/linux/Makefile.am: Add support for new files.
	* libc/sys/linux/configure.in: Add $EXTRA_DIRS variable.
	* libc/sys/linux/Makefile.in: Regenerated.
	* libc/sys/linux/configure: Ditto.
	* libc/sys/linux/io.c: Add poll syscall.  Also weak-alias
	__close, __read, __write, __poll, __open, __lseek, __fcntl from
	their __libc_ counterparts.
	* libc/sys/linux/io64.c: Add __libc_ prefix to lseek64 and open64
	and weak-alias to regular names.
	* libc/sys/linux/pread64.c: Rename to __libc_pread64 and weak-alias
	to pread64 and __pread64.
	* libc/sys/linux/process.c: Weak_alias __libc_getpid to __getpid.
	* libc/sys/linux/pwrite64.c: Rename to __libc_pwrite64 and
	weak-alias to pwrite64.
	* libc/sys/linux/sched.c: Weak-alias __libc_sched_getparam,
	__libc_sched_getscheduler, __libc_sched_get_priority_max,
	__libc_sched_get_priority_min, and __libc_sched_setschedule to
	name with __ instead of __libc_.
	* libc/sys/linux/siglongjmp.c: Include <machine/weakalias.h>.
	Rename siglongjmp to __libc_siglongjmp and weak-alias to siglongjmp.
	Call __libc_longjmp instead of longjmp, from __libc_siglongjmp.
	* libc/sys/linux/signal.c: Rename raise to __libc_raise and weak-alias
	to raise.
	* libc/sys/linux/socket.c: Weak-alias __libc_connect to __connect and
	__libc_send to __send.
	* libc/sys/linux/time.c: Weak-alias __libc_gettimeofday to
	__gettimeofday.
	* libc/sys/linux/wait.c: Rename wait to __libc_wait and weak-alias
	it to wait.  Rename wait3 to __libc_wait3 and weak-alias it to wait3.
	* libc/sys/linux/include/setjmp.h: Use __jmp_buf in sigjmp_buf
	type and typedef __jmp_buf to jmp_buf.
	* libc/sys/linux/machine/i386/Makefile.am: Add syscalls.c and
	setjmp.S.
	* libc/sys/linux/machine/i386/Makefile.in: Regenerated.
	* libc/sys/linux/machine/i386/crt0.c: Add support to clear .bss
	section.
	* libc/sys/linux/machine/i386/socketcall.h: Change to use __libc_
	prefix for function macros and then use weak_alias() to regular names.
	* libc/sys/linux/machine/i386/syscall.h: Ditto.
	* libc/sys/linux/sys/errno.h: Define EOPNOTSUP to be ENOTSUP.
	* libc/sys/linux/sys/stdio.h: Define _flockfile and _funlockfile
	to be flockfile() and funlockfile() respectively.
	* libc/sys/linux/sys/types.h
	* libc/reent/getreent.c: New file.
	* libc/sys/linux/flockfile.c: Ditto.
	* libc/sys/linux/funlockfile.c: Ditto.
	* libc/sys/linux/getreent.c: Ditto.
	* libc/sys/linux/pread.c: Ditto.
	* libc/sys/linux/pwrite.c: Ditto.
	* libc/sys/linux/raise.c: Ditto.
	* libc/sys/linux/system.c: Ditto.
	* libc/sys/linux/tcdrain.c: Ditto.
	* libc/sys/linux/machine/i386/i386mach.h: Ditto.
	* libc/sys/linux/machine/i386/setjmp.S: Ditto.
	* libc/sys/linux/machine/i386/syscalls.c: Ditto.
	* libc/sys/linux/machine/i386/weakalias.h: Ditto.
	* libc/sys/linux/machine/i386/include/setjmp.h: Ditto.
2002-05-17 23:39:39 +00:00
Thomas Fitzsimmons 7649080606 * libc/stdio/getc_u.c: New file.
* libc/stdio/getchar_u.c: New file.
	* libc/stdio/putc_u.c: New file.
	* libc/stdio/putchar_u.c: New file.
	* libc/include/stdio.h: Add declarations for getc_unlocked,
	getchar_unlocked, putc_unlocked and putchar_unlocked.
	* libc/stdio/Makefile.am (LIB_SOURCES): Add new files.
	(CHEWOUT_FILES): Add new files' .def's.
	* libc/stdio/putchar.c (_putchar_r): Replace __sputc with putc.
2002-05-08 19:11:22 +00:00
Thomas Fitzsimmons e71372faea * libc/include/sys/stdio.h: New file.
* libc/sys/linux/sys/stdio.h: New file.
	* libc/include/stdio.h: Add declarations for flockfile,
	ftrylockfile, and funlockfile.  Include <sys/stdio.h>.
	* libc/stdio/clearerr.c: Add file locking.
	* libc/stdio/fclose.c: Likewise.
	* libc/stdio/feof.c: Likewise.
	* libc/stdio/ferror.c: Likewise.
	* libc/stdio/fflush.c: Likewise.
	* libc/stdio/fgetc.c: Likewise.
	* libc/stdio/fgetpos.c: Likewise.
	* libc/stdio/fgets.c: Likewise.
	* libc/stdio/fileno.c: Likewise.
	* libc/stdio/fputc.c: Likewise.
	* libc/stdio/fputs.c: Likewise.
	* libc/stdio/fread.c: Likewise.
	* libc/stdio/freopen.c: Likewise.
	* libc/stdio/fseek.c: Likewise.
	* libc/stdio/ftell.c: Likewise.
	* libc/stdio/fwrite.c: Likewise.
	* libc/stdio/getc.c: Likewise.
	* libc/stdio/putc.c: Likewise.
	* libc/stdio/setvbuf.c: Likewise.
	* libc/stdio/ungetc.c: Likewise.
	* libc/stdio/vfprintf.c: Likewise.
2002-05-08 00:12:49 +00:00
Jeff Johnston a7061f7f50 2001-08-02 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h (BUFSIZ): Define to __BUFSIZ__ if provided,
        otherwise default.
2001-08-02 22:28:40 +00:00
Jeff Johnston 52cb9e6934 2001-04-20 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h[!_REENT_ONLY]: Moved various functions together
        into one list.
        [!__STRICT_ANSI__]: Moved non-ANSI I/O functions in this list.
        (vfscanf, vscanf, vsscanf, _vfscanf_r, _vscanf_r, _vsscanf_r): New
        function prototypes.
        (_fscanf_r, _sscanf_r): Ditto.
        * libc/include/stdlib.h: Added _strtod_r prototype.
        * libc/stdio/Makefile.am: Add new v*scanf functions.
        * libc/stdio/Makefile.in: Regenerate.
        * libc/stdio/fscanf.c: Reorganized so HAVE_STDC only affects prototype
        and code is shared.  Added reentrant _fscanf_r which calls __svfscanf_r.        * libc/stdio/scanf.c: Changed to call __svfscanf_r.
        * libc/stdio/sscanf.c: Changed documentation to add reentrant routines.
        (sscanf): Changed to call __svfscanf_r with _REENT argument.
        (_sscanf_r): New routine.
        * libc/stdio/local.h: Removed __svfscanf prototype and replaced it
        with __svfscanf_r prototype.
        * libc/stdio/vfscanf.c (vfscanf, _vfscanf_r: New
        routines.
        (__svfscanf_r): Reentrant version of __svfscanf which takes reetrancy
        structure as argument as calls reentrant versions of helper functions
        (e.g. _strtol_r, _strtoul_r). Also replaced calls to atol and atof
        to _strtol_r and _strtod_r respectively.
        * libc/stdio/vfscanf.c: Also changed __svfscanf to call __svfscanf_r.
        * libc/stdlib/strtod.c (strtod): Changed to call _strtod_r with
        _REENT argument.
        * libc/stdio/vscanf.c: New file.
        * libc/stdio/vsscanf.c: Ditto.
2001-04-20 22:50:51 +00:00
Jeff Johnston 5336d6de84 2001-02-08 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Revert putw prototype.
2001-02-09 00:32:43 +00:00
Jeff Johnston 8915d10a26 2001-02-08 Edward M. Lee <tailbert@yahoo.com>
* libc/include/grp.h: add prototype for initgroups.
        * libc/include/stdio.h: fix prototype for putw.
        * libc/include/sys/signal.h: add prototype for killpg.
        * libc/include/sys/stat.h: enable mknod/lstat for CYGWIN.
        * libc/include/sys/unistd.h: add prototypes for getpgid, setpgrp,
        vhangup and remove duplicate sysconf prototype.
2001-02-09 00:13:54 +00:00
Jeff Johnston e29d83550e 2001-01-31 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h (FILENAME_MAX): Changed to use __FILENAME_MAX__
        if defined.
        (FOPEN_MAX): Changed to use __FOPEN_MAX__ if defined.
        (L_tmpnam): Changed to use __L_tmpnam__ if defined.
        * libc/include/sys/config.h: Changed to set __FILENAME_MAX__
        appropriately for Cygwin and RTEMS so not to exceed PATH_MAX.
2001-01-31 20:11:48 +00:00
Christopher Faylor d2dd57657c * libc/include/ctype.h: __CYGWIN32__ -> __CYGWIN__
* libc/include/malloc.h: Ditto.
* libc/include/process.h: Ditto.
* libc/include/stdio.h: Ditto.
* libc/include/stdlib.h: Ditto.
* libc/include/time.h: Ditto.
* libc/include/machine/setjmp.h: Ditto.
* libc/include/sys/errno.h: Ditto.
* libc/include/sys/signal.h: Ditto.
* libc/include/sys/stat.h: Ditto.
* libc/include/sys/time.h: Ditto.
* libc/include/sys/unistd.h: Ditto.
* libc/include/string.h: Ditto.  strsignal should return a const char *.
2000-05-30 17:18:05 +00:00
DJ Delorie c4e1aa0115 * libc/stdio/stdio.c (__stextmode): new, see if file is text mode
(__sread): always read in binary mode
(__swrite): always write in binary mode
* libc/include/stdio.h: no getc/putc macros for cygwin; causes
compatibility issues with different dll versions
* libc/stdio/fopen.c: use __stextmode
* libc/stdio/fdopen.c: ditto
* libc/stdio/freopen.c: ditto
* libc/stdio/findfp.c: set up __SCLE for std{in,out,err}
* libc/stdio/local.h: declare __stextmode
2000-05-23 23:51:54 +00:00
Jeff Johnston 49d64538cd Tue May 02 23:45:48 2000 DJ Delorie <dj@cygnus.com>
* libc/include/stdio.h (FILE): define __SCLE for "convert line
        endings" for Cygwin.
        (__sgetc): convert line endings if needed
        (__sputc): ditto
        * libc/stdio/fdopen.c (_fdopen_r): Remember if we opened in text mode
        * libc/stdio/fopen.c (_fopen_r): ditto
        * libc/stdio/freopen.c (freopen): ditto
        * libc/stdio/fread.c (fread): perform CRLF conversions if __SCLE
        * libc/stdio/fvwrite.c (__sfvwrite): ditto
2000-05-03 03:57:19 +00:00
Christopher Faylor 8a0efa53e4 import newlib-2000-02-17 snapshot 2000-02-17 19:39:52 +00:00