File:  [MW Coherent from dump] / coherent / b / lib / libc / XSTDIO / fsetpos.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:36 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * libc/stdio/fsetpos.c
 * ANSI-compliant C standard i/o library.
 * fsetpos()
 * ANSI 4.9.9.3.
 * Set file position.
 * Assumes files not longer than LONG_MAX,
 * so fsetpos() is just an fseek().
 * fseek() does not set errno if an error occurs.
 */

#include <stdio.h>
#include <errno.h>

#define	EFSETPOS	EINVAL

int
fsetpos(stream, pos) FILE *stream; const fpos_t *pos;
{
	register int status;

	if ((status = fseek(stream, (long)(*pos), SEEK_SET)) != 0)
		errno = EFSETPOS;
	return status;
}

/* end of libc/stdio/fsetpos.c */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.