diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-04 19:33:54 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-07-04 19:33:54 +0000 |
commit | 30b2092fcb3283a42447e47a549e216fd90945ec (patch) | |
tree | ee2e0efa7f936068868aaf1f2c508e8035d77428 /newlib/libc/stdio/fseek.c | |
parent | 7501704dc9dc7337e621db87ada8901a496766d9 (diff) | |
download | cygnal-30b2092fcb3283a42447e47a549e216fd90945ec.tar.gz cygnal-30b2092fcb3283a42447e47a549e216fd90945ec.tar.bz2 cygnal-30b2092fcb3283a42447e47a549e216fd90945ec.zip |
2002-07-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/stdio.h: Add new prototypes.
* libc/stdio/Makefile.am: Add fseeko.c and ftello.c.
* libc/stdio/Makefile.in: Regenerated.
* libc/stdio/fseek.c: Add fseeko documentation.
* libc/stdio/ftell.c: Add ftello documentation.
* libc/stdio/fseeko.c: New file.
* libc/stdio/ftello.c: New file.
Diffstat (limited to 'newlib/libc/stdio/fseek.c')
-rw-r--r-- | newlib/libc/stdio/fseek.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/newlib/libc/stdio/fseek.c b/newlib/libc/stdio/fseek.c index 27f527545..8912dd60c 100644 --- a/newlib/libc/stdio/fseek.c +++ b/newlib/libc/stdio/fseek.c @@ -17,14 +17,17 @@ /* FUNCTION -<<fseek>>---set file position +<<fseek>>, <<fseeko>>---set file position INDEX fseek +INDEX + fseeko ANSI_SYNOPSIS #include <stdio.h> int fseek(FILE *<[fp]>, long <[offset]>, int <[whence]>) + int fseeko(FILE *<[fp]>, off_t <[offset]>, int <[whence]>) TRAD_SYNOPSIS #include <stdio.h> @@ -33,12 +36,17 @@ TRAD_SYNOPSIS long <[offset]>; int <[whence]>; + int fseeko(<[fp]>, <[offset]>, <[whence]>) + FILE *<[fp]>; + off_t <[offset]>; + int <[whence]>; + 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 depend on this position, and many change it as a side effect. -You can use <<fseek>> to set the position for the file identified by +You can use <<fseek>>/<<fseeko>> to set the position for the file identified by <[fp]>. The value of <[offset]> determines the new position, in one of three ways selected by the value of <[whence]> (defined as macros in `<<stdio.h>>'): @@ -53,10 +61,10 @@ from the beginning of the file) desired. <[offset]> must be positive. <[offset]> can meaningfully be either positive (to increase the size of the file) or negative. -See <<ftell>> to determine the current file position. +See <<ftell>>/<<ftello>> to determine the current file position. RETURNS -<<fseek>> returns <<0>> when successful. If <<fseek>> fails, the +<<fseek>>/<<fseeko>> return <<0>> when successful. On failure, the result is <<EOF>>. The reason for failure is indicated in <<errno>>: either <<ESPIPE>> (the stream identified by <[fp]> doesn't support repositioning) or <<EINVAL>> (invalid file position). @@ -64,6 +72,8 @@ repositioning) or <<EINVAL>> (invalid file position). PORTABILITY ANSI C requires <<fseek>>. +<<fseeko>> is defined by the Single Unix specification. + Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>, <<read>>, <<sbrk>>, <<write>>. */ |