Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
/*
2
 * pANS stdio -- fopen
3
 */
4
#include "iolib.h"
5
FILE *fopen(const char *name, const char *mode){
6
	FILE *f;
7
	qlock(&_stdiolk);
8
	for(f=_IO_stream;f!=&_IO_stream[FOPEN_MAX];f++) {
9
		if(f->state==CLOSED) {
10
			qunlock(&_stdiolk);
11
			return freopen(name, mode, f);
12
		}
13
	}
14
	qunlock(&_stdiolk);
15
	return NULL;
16
}