Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2007-06-04 22:10:17 +0400
committerEric Blake <eblake@redhat.com>2007-06-04 22:10:17 +0400
commit17c61d6a2c4868260c1ef3043e03f86de14f6a08 (patch)
treec795768b8f7d0fa0048f5bd77f6dad9c5ce069e1 /newlib/libc/stdio64/stdio64.c
parent6a3b4eb69a7d2b1e1c19a8baef42ce6dc3d61a86 (diff)
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/stdio64/stdio64.c')
-rw-r--r--newlib/libc/stdio64/stdio64.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/newlib/libc/stdio64/stdio64.c b/newlib/libc/stdio64/stdio64.c
index 35967ad99..f33a394a7 100644
--- a/newlib/libc/stdio64/stdio64.c
+++ b/newlib/libc/stdio64/stdio64.c
@@ -26,11 +26,11 @@
#ifdef __LARGE64_FILES
_fpos64_t
-__sseek64_r (ptr, cookie, offset, whence)
- struct _reent *ptr;
- _PTR cookie;
- _fpos64_t offset;
- int whence;
+_DEFUN(__sseek64, (ptr, cookie, offset, whence),
+ struct _reent *ptr _AND
+ void *cookie _AND
+ _fpos64_t offset _AND
+ int whence)
{
register FILE *fp = (FILE *) cookie;
register _off64_t ret;
@@ -47,11 +47,11 @@ __sseek64_r (ptr, cookie, offset, whence)
}
_READ_WRITE_RETURN_TYPE
-__swrite64_r (ptr, cookie, buf, n)
- struct _reent *ptr;
- _PTR cookie;
- char _CONST *buf;
- int n;
+_DEFUN(__swrite64, (ptr, cookie, buf, n),
+ struct _reent *ptr _AND
+ void *cookie _AND
+ char const *buf _AND
+ int n)
{
register FILE *fp = (FILE *) cookie;
int w;
@@ -78,26 +78,4 @@ __swrite64_r (ptr, cookie, buf, n)
return w;
}
-#ifndef _REENT_ONLY
-_fpos64_t
-__sseek64 (cookie, offset, whence)
- _PTR cookie;
- _fpos64_t offset;
- int whence;
-{
- return __sseek64_r (_REENT, cookie, offset, whence);
-}
-
-_READ_WRITE_RETURN_TYPE
-__swrite64 (cookie, buf, n)
- _PTR cookie;
- char _CONST *buf;
- int n;
-{
- return __swrite64_r (_REENT, cookie, buf, n);
-}
-
-#endif /* !_REENT_ONLY */
-
#endif /* __LARGE64_FILES */
-