File:  [Power 6/32 Unix Tahoe 4.2BSD] / cci / usr / src / usr.lib / libsI77 / rewind.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Sun Jul 28 12:24:19 2019 UTC (6 years, 11 months ago) by root
Branches: bsd, MAIN
CVS tags: v12b, v121, HEAD
Power 6/32 Unix version 1.2b

/*
char id_rewind[] = "@(#)rewind.c	1.2";
 *
 * rewind.c  -  f77 file rewind
 */

#include "fio.h"

f_rew(a) alist *a;
{	int n;
	unit *b;

	lfname = NULL;
	elist = NO;
	external = YES;			/* for err */
	lunit = a->aunit;
	errflag = a->aerr;
	if(not_legal(lunit)) err(errflag,F_ERUNIT,"rewind")
	b = &units[lunit];
	if(!b->ufd && (n=fk_open(READ,SEQ,FMT,(ftnint)lunit)) )
		err(errflag,n,"rewind")
	lfname = b->ufnm;
	if(!b->useek) err(errflag,F_ERNOBKSP,"rewind")
	b->uend = NO;
	if(b->uwrt)
		if(n=t_runc(b,errflag)) return(n);
	rewind(b->ufd);
	return(OK);
}

unix.superglobalmegacorp.com

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