OSDN Git Service

Implement funopen, fopencookie.
authorericb <ericb>
Mon, 4 Jun 2007 18:10:16 +0000 (18:10 +0000)
committerericb <ericb>
Mon, 4 Jun 2007 18:10:16 +0000 (18:10 +0000)
commit3a784d0d155b0d31555384b952e0b2b83cb96af3
treef885476eae0bad7846c1e2fab65576f9c2cf3956
parenta95186833441c0d5b28a155acce6c961d6e58a95
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.
25 files changed:
newlib/ChangeLog
newlib/libc/include/stdio.h
newlib/libc/include/sys/reent.h
newlib/libc/stdio/Makefile.am
newlib/libc/stdio/Makefile.in
newlib/libc/stdio/fclose.c
newlib/libc/stdio/fflush.c
newlib/libc/stdio/flags.c
newlib/libc/stdio/fopencookie.c [new file with mode: 0644]
newlib/libc/stdio/freopen.c
newlib/libc/stdio/fseek.c
newlib/libc/stdio/ftell.c
newlib/libc/stdio/funopen.c [new file with mode: 0644]
newlib/libc/stdio/fvwrite.c
newlib/libc/stdio/local.h
newlib/libc/stdio/refill.c
newlib/libc/stdio/siscanf.c
newlib/libc/stdio/sscanf.c
newlib/libc/stdio/stdio.c
newlib/libc/stdio/vsiscanf.c
newlib/libc/stdio/vsscanf.c
newlib/libc/stdio64/freopen64.c
newlib/libc/stdio64/fseeko64.c
newlib/libc/stdio64/ftello64.c
newlib/libc/stdio64/stdio64.c