File:  [Research Unix] / researchv9 / libc / fio / fioseek.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:22:00 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

#define	FIO_IMP
#include	"fio.h"
#include	<libc.h>

long
Fseek(fd, n, cmd)
	long n;
{
	register Fbuffer *f;
	register long dest, k;

	FIOSET(f, fd);
	dest = SEEK(fd, n, cmd);
	if(dest < 0)
		return(dest);
	k = f->end-f->lnext;
	if((dest >= f->offset) || (dest < f->offset-k)){
		FIORESET(f);
		f->offset = dest;
	} else {
		f->next = f->lnext + (dest-(f->offset-k));
		SEEK(fd, f->offset, 0);
	}
	return(dest);
}

unix.superglobalmegacorp.com

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