diff options
author | Eric Blake <eblake@redhat.com> | 2007-06-04 18:10:17 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2007-06-04 18:10:17 +0000 |
commit | 17c61d6a2c4868260c1ef3043e03f86de14f6a08 (patch) | |
tree | c795768b8f7d0fa0048f5bd77f6dad9c5ce069e1 /newlib/libc/stdio/local.h | |
parent | 6a3b4eb69a7d2b1e1c19a8baef42ce6dc3d61a86 (diff) | |
download | cygnal-17c61d6a2c4868260c1ef3043e03f86de14f6a08.tar.gz cygnal-17c61d6a2c4868260c1ef3043e03f86de14f6a08.tar.bz2 cygnal-17c61d6a2c4868260c1ef3043e03f86de14f6a08.zip |
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.
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r-- | newlib/libc/stdio/local.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h index 0dba774ae..f02f91d57 100644 --- a/newlib/libc/stdio/local.h +++ b/newlib/libc/stdio/local.h @@ -25,19 +25,25 @@ #include <_ansi.h> #include <reent.h> #include <stdarg.h> -#include <reent.h> #include <stdlib.h> #include <unistd.h> +#include <stdio.h> +#ifdef __SCLE +# include <io.h> +#endif + extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list)); extern FILE *_EXFUN(__sfp,(struct _reent *)); extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*)); extern int _EXFUN(__srefill_r,(struct _reent *,FILE *)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(_PTR, char *, int)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(_PTR, char _CONST *, int)); -extern _fpos_t _EXFUN(__sseek,(_PTR, _fpos_t, int)); -extern int _EXFUN(__sclose,(_PTR)); +extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(struct _reent *, void *, char *, + int)); +extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(struct _reent *, void *, + const char *, int)); +extern _fpos_t _EXFUN(__sseek,(struct _reent *, void *, _fpos_t, int)); +extern int _EXFUN(__sclose,(struct _reent *, void *)); extern int _EXFUN(__stextmode,(int)); extern _VOID _EXFUN(__sinit,(struct _reent *)); extern _VOID _EXFUN(_cleanup_r,(struct _reent *)); @@ -47,11 +53,9 @@ extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(struct _reent *, FIL struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); #ifdef __LARGE64_FILES -extern _fpos64_t _EXFUN(__sseek64,(void *, _fpos64_t, int)); -extern _fpos64_t _EXFUN(__sseek64_r,(struct _reent *, void *, _fpos64_t, int)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(void *, char const *, int)); -extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64_r,(struct _reent *, void *, - char const *, int)); +extern _fpos64_t _EXFUN(__sseek64,(struct _reent *, void *, _fpos64_t, int)); +extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite64,(struct _reent *, void *, + const char *, int)); #endif /* Called by the main entry point fns to ensure stdio has been initialized. */ |