123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include <stdio.h>
- #include <string.h>
- #include "../misc/internals/tempname.h"
- static char tmpnam_buffer[L_tmpnam];
- char * tmpnam (char *s)
- {
-
- char tmpbuf[L_tmpnam];
-
- if (__path_search (s ? : tmpbuf, L_tmpnam, NULL, NULL, 0))
- return NULL;
- if (__gen_tempname (s ? : tmpbuf, __GT_NOCREATE))
- return NULL;
- if (s == NULL)
- return (char *) memcpy (tmpnam_buffer, tmpbuf, L_tmpnam);
- return s;
- }
|