shithub: riscv

ref: a898d31f76b7424aeb65b07350cec3539620d50e
dir: /sys/src/ape/lib/ap/stdio/clearerr.c/

View raw version
/*
 * pANS stdio -- clearerr
 */
#include "iolib.h"
void clearerr(FILE *f){
	switch(f->state){
	case ERR:
		f->state=f->buf?RDWR:OPEN;
		break;
	case END:
		f->state=RDWR;
		break;
	}
}