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_fixcpp/sys/src/libstdio/sopenw.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 -- sopenw
3
 */
4
#include "iolib.h"
5
FILE *sopenw(void){
6
	FILE *f;
7
	qlock(&_stdiolk);
8
	for(f=_IO_stream;f!=&_IO_stream[FOPEN_MAX];f++) if(f->state==CLOSED) break;
9
	if(f==&_IO_stream[FOPEN_MAX]) {
10
		qunlock(&_stdiolk);
11
		return NULL;
12
	}
13
	f->buf=f->rp=f->wp=0;
14
	f->state=OPEN;
15
	f->flags=STRING;
16
	f->fd=-1;
17
	qunlock(&_stdiolk);
18
	return f;
19
}