Annotation of researchv9/libc/gen/mktemp.c, revision 1.1.1.1

1.1       root        1: char *
                      2: mktemp(as)
                      3: char *as;
                      4: {
                      5:        register char *s;
                      6:        register unsigned pid;
                      7:        register i;
                      8:        extern int errno;
                      9:        register int oerrno = errno;
                     10: 
                     11:        pid = getpid();
                     12:        s = as;
                     13:        while (*s++)
                     14:                ;
                     15:        s--;
                     16:        while (*--s == 'X') {
                     17:                *s = (pid%10) + '0';
                     18:                pid /= 10;
                     19:        }
                     20:        s++;
                     21:        i = 'a';
                     22:        while (access(as, 0) != -1) {
                     23:                if (i=='z')
                     24:                        return("/");
                     25:                *s = i++;
                     26:        }
                     27:        errno = oerrno;
                     28:        return(as);
                     29: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.