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 -- tmpnam
3
 */
4
#include "iolib.h"
5
 
6
char *tmpnam(char *s){
7
	static char name[]="/tmp/tn000000000000";
8
	char *p;
9
	do{
10
		p=name+7;
11
		while(*p=='9') *p++='0';
12
		if(*p=='\0') return NULL;
13
		++*p;
14
	}while(access(name, 0)==0);
15
	if(s){
16
		strcpy(s, name);
17
		return s;
18
	}
19
	return name;
20
}