/* @(#)peekc.c	1.5 00/12/03 Copyright 1986 J. Schilling */
/*
 *	Copyright (c) 1986 J. Schilling
 */
/*@@C@@*/

#include "io.h"

EXPORT int
peekc (f)
	FILE *f;
{
	int	c;

	down2(f, _IOREAD, _IORW);

	if (ferror(f))
		return(EOF);
	if ((c = getc(f)) != EOF)
		ungetc(c, f);
	return(c);
}
