OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [libc/] [stdio64/] [fsetpos64.c] - Blame information for rev 823

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
/*
2
FUNCTION
3
<<fsetpos64>>---restore position of a large stream or file
4
 
5
INDEX
6
        fsetpos64
7
INDEX
8
        _fsetpos64_r
9
 
10
ANSI_SYNOPSIS
11
        #include <stdio.h>
12
        int fsetpos64(FILE *<[fp]>, const _fpos64_t *<[pos]>);
13
        int _fsetpos64_r(struct _reent *<[ptr]>, FILE *<[fp]>,
14
                         const _fpos64_t *<[pos]>);
15
 
16
TRAD_SYNOPSIS
17
        #include <stdio.h>
18
        int fsetpos64(<[fp]>, <[pos]>)
19
        FILE *<[fp]>;
20
        _fpos64_t *<[pos]>;
21
 
22
        int _fsetpos64_r(<[ptr]>, <[fp]>, <[pos]>)
23
        struct _reent *<[ptr]>;
24
        FILE *<[fp]>;
25
        _fpos64_t *<[pos]>;
26
 
27
DESCRIPTION
28
Objects of type <<FILE>> can have a ``position'' that records how much
29
of the file your program has already read.  Many of the <<stdio>> functions
30
depend on this position, and many change it as a side effect.
31
 
32
You can use <<fsetpos64>> to return the large file identified by <[fp]> to a
33
previous position <<*<[pos]>>> (after first recording it with <<fgetpos64>>).
34
 
35
See <<fseeko64>> for a similar facility.
36
 
37
RETURNS
38
<<fgetpos64>> returns <<0>> when successful.  If <<fgetpos64>> fails, the
39
result is <<1>>.  The reason for failure is indicated in <<errno>>:
40
either <<ESPIPE>> (the stream identified by <[fp]> doesn't support
41
64-bit repositioning) or <<EINVAL>> (invalid file position).
42
 
43
PORTABILITY
44
<<fsetpos64>> is a glibc extension.
45
 
46
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
47
<<lseek64>>, <<read>>, <<sbrk>>, <<write>>.
48
*/
49
 
50
#include <stdio.h>
51
 
52
#ifdef __LARGE64_FILES
53
 
54
int
55
_DEFUN (_fsetpos64_r, (ptr, iop, pos),
56
        struct _reent *ptr _AND
57
        FILE * iop _AND
58
        _CONST _fpos64_t * pos)
59
{
60
  int x = _fseeko64_r (ptr, iop, (_off64_t)(*pos), SEEK_SET);
61
 
62
  if (x != 0)
63
    return 1;
64
  return 0;
65
}
66
 
67
#ifndef _REENT_ONLY
68
 
69
int
70
_DEFUN (fsetpos64, (iop, pos),
71
        FILE * iop _AND
72
        _CONST _fpos64_t * pos)
73
{
74
  return _fsetpos64_r (_REENT, iop, pos);
75
}
76
 
77
#endif /* !_REENT_ONLY */
78
 
79
#endif /* __LARGE64_FILES */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.