diff options
Diffstat (limited to 'newlib/libc/stdio/fsetpos.c')
-rw-r--r-- | newlib/libc/stdio/fsetpos.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/newlib/libc/stdio/fsetpos.c b/newlib/libc/stdio/fsetpos.c index 3748b665c..75f719b22 100644 --- a/newlib/libc/stdio/fsetpos.c +++ b/newlib/libc/stdio/fsetpos.c @@ -4,10 +4,14 @@ FUNCTION INDEX fsetpos +INDEX + _fsetpos_r ANSI_SYNOPSIS #include <stdio.h> int fsetpos(FILE *<[fp]>, const fpos_t *<[pos]>); + int _fsetpos_r(struct _reent *<[ptr]>, FILE *<[fp]>, l + const fpos_t *<[pos]>); TRAD_SYNOPSIS #include <stdio.h> @@ -15,6 +19,11 @@ TRAD_SYNOPSIS FILE *<[fp]>; fpos_t *<[pos]>; + int _fsetpos_r(<[ptr]>, <[fp]>, <[pos]>) + struct _reent *<[ptr]>; + FILE *<[fp]>; + fpos_t *<[pos]>; + DESCRIPTION Objects of type <<FILE>> can have a ``position'' that records how much of the file your program has already read. Many of the <<stdio>> functions @@ -42,13 +51,26 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, #include <stdio.h> int -_DEFUN (fsetpos, (iop, pos), +_DEFUN (_fsetpos_r, (ptr, iop, pos), + struct _reent * ptr _AND FILE * iop _AND _CONST _fpos_t * pos) { - int x = fseek (iop, *pos, SEEK_SET); + int x = _fseek_r (ptr, iop, *pos, SEEK_SET); if (x != 0) return 1; return 0; } + +#ifndef _REENT_ONLY + +int +_DEFUN (fsetpos, (iop, pos), + FILE * iop _AND + _CONST _fpos_t * pos) +{ + return _fsetpos_r (_REENT, iop, pos); +} + +#endif /* !_REENT_ONLY */ |