1 /* $Id: mktemp.c,v 1.2 1994/06/24 11:45:32 ceriel Exp $ */
2 /* mktemp - make a name for a temporary file; only here for backwards compat */
3 /* no _-protected system-calls? */
5 unsigned int getpid(void);
6 int access(char *, int);
8 char *mktemp(char *template)
13 pid = getpid(); /* get process id as semi-unique number */
15 while (*p) p++; /* find end of string */
17 /* Replace XXXXXX at end of template with pid. */
19 *p = '0' + (pid % 10);
23 for (k = 'a'; k <= 'z'; k++) {
25 if (access(template, 0) < 0) {