Annotation of 41BSD/libc/gen/mktemp.c, revision 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: 
        !             9:        pid = getpid();
        !            10:        s = as;
        !            11:        while (*s++)
        !            12:                ;
        !            13:        s--;
        !            14:        while (*--s == 'X') {
        !            15:                *s = (pid%10) + '0';
        !            16:                pid /= 10;
        !            17:        }
        !            18:        s++;
        !            19:        i = 'a';
        !            20:        while (access(as, 0) != -1) {
        !            21:                if (i=='z')
        !            22:                        return("/");
        !            23:                *s = i++;
        !            24:        }
        !            25:        return(as);
        !            26: }

unix.superglobalmegacorp.com

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