1fsetpos(3C) Standard C Library Functions fsetpos(3C)
2
3
4
6 fsetpos - reposition a file pointer in a stream
7
9 #include <stdio.h>
10
11 int fsetpos(FILE *stream, const fpos_t *pos);
12
13
15 The fsetpos() function sets the file position indicator for the stream
16 pointed to by stream according to the value of the object pointed to by
17 pos, which must be a value obtained from an earlier call to fgetpos(3C)
18 on the same stream.
19
20
21 A successful call to fsetpos() function clears the end-of-file indica‐
22 tor for the stream and undoes any effects of ungetc(3C) on the same
23 stream. After an fsetpos() call, the next operation on an update
24 stream may be either input or output.
25
27 The fsetpos() function returns 0 if it succeeds; otherwise it returns a
28 non-zero value and sets errno to indicate the error.
29
31 The fsetpos() function may fail if:
32
33 EBADF The file descriptor underlying stream is not valid.
34
35
36 ESPIPE The file descriptor underlying stream is associated with a
37 pipe, a FIFO, or a socket.
38
39
41 The fsetpos() function has a transitional interface for 64-bit file
42 offsets. See lf64(5).
43
45 See attributes(5) for descriptions of the following attributes:
46
47
48
49
50 ┌─────────────────────────────┬─────────────────────────────┐
51 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
52 ├─────────────────────────────┼─────────────────────────────┤
53 │Interface Stability │Standard │
54 ├─────────────────────────────┼─────────────────────────────┤
55 │MT-Level │MT-Safe │
56 └─────────────────────────────┴─────────────────────────────┘
57
59 lseek(2), fgetpos(3C), fopen(3C), fseek(3C), ftell(3C), rewind(3C),
60 ungetc(3C), attributes(5), lf64(5), standards(5)
61
62
63
64SunOS 5.11 24 Jul 2002 fsetpos(3C)