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:
Diffstat (limited to 'newlib/libc/stdio/rewind.c')
-rw-r--r--newlib/libc/stdio/rewind.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/newlib/libc/stdio/rewind.c b/newlib/libc/stdio/rewind.c
index 905275741..2b9f3191f 100644
--- a/newlib/libc/stdio/rewind.c
+++ b/newlib/libc/stdio/rewind.c
@@ -21,16 +21,23 @@ FUNCTION
INDEX
rewind
+INDEX
+ _rewind_r
ANSI_SYNOPSIS
#include <stdio.h>
void rewind(FILE *<[fp]>);
+ void _rewind_r(struct _reent *<[ptr]>, FILE *<[fp]>);
TRAD_SYNOPSIS
#include <stdio.h>
void rewind(<[fp]>)
FILE *<[fp]>;
+ void _rewind_r(<[ptr]>, <[fp]>)
+ struct _reent *<[ptr]>;
+ FILE *<[fp]>;
+
DESCRIPTION
<<rewind>> returns the file position indicator (if any) for the file
or stream identified by <[fp]> to the beginning of the file. It also
@@ -52,9 +59,21 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#include <stdio.h>
void
-_DEFUN (rewind, (fp),
+_DEFUN (_rewind_r, (ptr, fp),
+ struct _reent * ptr _AND
register FILE * fp)
{
- (void) fseek(fp, 0L, SEEK_SET);
+ (void) _fseek_r (ptr, fp, 0L, SEEK_SET);
clearerr(fp);
}
+
+#ifndef _REENT_ONLY
+
+void
+_DEFUN (rewind, (fp),
+ register FILE * fp)
+{
+ (void) _fseek_r (_REENT, fp, 0L, SEEK_SET);
+}
+
+#endif /* !_REENT_ONLY */