|
|
1.1 root 1: /*
2: * libc/stdio/fsetpos.c
3: * ANSI-compliant C standard i/o library.
4: * fsetpos()
5: * ANSI 4.9.9.3.
6: * Set file position.
7: * Assumes files not longer than LONG_MAX,
8: * so fsetpos() is just an fseek().
9: * fseek() does not set errno if an error occurs.
10: */
11:
12: #include <stdio.h>
13: #include <errno.h>
14:
15: #define EFSETPOS EINVAL
16:
17: int
18: fsetpos(stream, pos) FILE *stream; const fpos_t *pos;
19: {
20: register int status;
21:
22: if ((status = fseek(stream, (long)(*pos), SEEK_SET)) != 0)
23: errno = EFSETPOS;
24: return status;
25: }
26:
27: /* end of libc/stdio/fsetpos.c */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.