10 char *tempnam(const char *dir, const char *pfx)
18 if (!dir) dir = P_tmpdir;
19 if (!pfx) pfx = "temp";
21 if (access(dir, R_OK|W_OK|X_OK) != 0)
24 l = strlen(dir) + 1 + strlen(pfx) + 2 + sizeof(int)*3*2 + 1;
32 for (; index < TMP_MAX; index++) {
33 snprintf(s, l, "%s/%s-%d-%d", dir, pfx, pid, index);
34 if (access(s, F_OK) != 0) {