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

/*
 * Standard I/O Library
 * Seek; first ensure buffer is clean; afterwards put ptrs at right place.
 */

#include <stdio.h>

int
fseek(fp, offset, origin)
register FILE	*fp;
long	offset;
int	origin;
{
	long	lseek();

	if ((origin == SEEK_CUR) && (fp->_ff & _FUNGOT))
		offset--;
	if (_fpseek(fp)==EOF)
		return (EOF);
	if ((offset=lseek(fileno(fp), offset, origin)) == -1L)
		return (EOF);
	if (fp->_bp!=NULL)
		fp->_dp = fp->_cp = fp->_bp + (unsigned)offset%BUFSIZ;
	fp->_ff &= ~_FEOF;
	return (0);
}

unix.superglobalmegacorp.com

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