diff options
Diffstat (limited to 'newlib/libc/stdio64/freopen64.c')
-rw-r--r-- | newlib/libc/stdio64/freopen64.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index 1828b0656..6e4586cd9 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -21,11 +21,15 @@ FUNCTION INDEX freopen64 +INDEX + _freopen64_r ANSI_SYNOPSIS #include <stdio.h> FILE *freopen64(const char *<[file]>, const char *<[mode]>, FILE *<[fp]>); + FILE *_freopen64_r(struct _reent *<[ptr]>, const char *<[file]>, + const char *<[mode]>, FILE *<[fp]>); TRAD_SYNOPSIS #include <stdio.h> @@ -34,6 +38,12 @@ TRAD_SYNOPSIS char *<[mode]>; FILE *<[fp]>; + FILE *_freopen64_r(<[ptr]>, <[file]>, <[mode]>, <[fp]>) + struct _reent *<[ptr]>; + char *<[file]>; + char *<[mode]>; + FILE *<[fp]>; + DESCRIPTION Use this variant of <<fopen64>> if you wish to specify a particular file descriptor <[fp]> (notably <<stdin>>, <<stdout>>, or <<stderr>>) for @@ -69,19 +79,18 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, #ifdef __LARGE64_FILES FILE * -_DEFUN (freopen64, (file, mode, fp), +_DEFUN (_freopen64_r, (ptr, file, mode, fp), + struct _reent *ptr _AND _CONST char *file _AND _CONST char *mode _AND register FILE *fp) { register int f; int flags, oflags, e; - struct _reent *ptr; _flockfile(fp); CHECK_INIT (fp); - ptr = fp->_data; if ((flags = __sflags (ptr, mode, &oflags)) == 0) { @@ -166,4 +175,17 @@ _DEFUN (freopen64, (file, mode, fp), return fp; } +#ifndef _REENT_ONLY + +FILE * +_DEFUN (freopen64, (file, mode, fp), + _CONST char *file _AND + _CONST char *mode _AND + register FILE *fp) +{ + return _freopen64_r (_REENT, file, mode, fp); +} + +#endif /* !_REENT_ONLY */ + #endif /* __LARGE64_FILES */ |