2 * pANS stdio -- tmpfile
4 * Bug: contains a critical section. Two executions by the same
5 * user could interleave as follows, both yielding the same file:
12 * As I read the pANS, this can't reasonably use tmpnam to generate
13 * the name, so that code is duplicated.
17 static char tmpsmade[FOPEN_MAX][L_tmpnam+1];
20 static void rmtmps(void);
24 static char name[]="/tmp/tf0000000000000";
26 while(access(name, 0)==0){
28 while(*p=='9') *p++='0';
29 if(*p=='\0') return NULL;
33 if(f && ntmps<FOPEN_MAX){
36 strcpy(tmpsmade[ntmps++], name);
46 for(i=0; i<ntmps; i++)