1: #if defined(LIBC_SCCS) && !defined(lint)
   2: static char sccsid[] = "@(#)mktemp.c	5.2 (Berkeley) 3/9/86";
   3: #endif LIBC_SCCS and not lint
   4: 
   5: char *
   6: mktemp(as)
   7: char *as;
   8: {
   9:     register char *s;
  10:     register unsigned pid;
  11:     register i;
  12: 
  13:     pid = getpid();
  14:     s = as;
  15:     while (*s++)
  16:         ;
  17:     s--;
  18:     while (*--s == 'X') {
  19:         *s = (pid%10) + '0';
  20:         pid /= 10;
  21:     }
  22:     s++;
  23:     i = 'a';
  24:     while (access(as, 0) != -1) {
  25:         if (i=='z')
  26:             return("/");
  27:         *s = i++;
  28:     }
  29:     return(as);
  30: }

Defined functions

mktemp defined in line 5; used 172 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1237
Valid CSS Valid XHTML 1.0 Strict