DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b0ea721d5⟧ TextFile

    Length: 416 (0x1a0)
    Types: TextFile
    Notes: UNIX file
    Names: »fseek.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libc/stdio/fseek.c« 

TextFile

/*
 * 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 (_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 + (int)offset%BUFSIZ;
	return (0);
}