Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_unix/sys/src/libstdio/fopen.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | 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
}