Initial revision

This commit is contained in:
ceriel
1988-04-19 09:34:37 +00:00
parent 5140441585
commit a61b1a19bb
113 changed files with 2057 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
/* mktemp - make a name for a temporary file */
char *mktemp(template)
char *template;
{
int pid, k;
char *p;
pid = getpid(); /* get process id as semi-unique number */
p = template;
while (*p++) ; /* find end of string */
p--; /* backup to last character */
/* Replace XXXXXX at end of template with pid. */
while (*--p == 'X') {
*p = '0' + (pid % 10);
pid = pid/10;
}
return(template);
}