1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <stdio.h>
- #include <string.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;
- }
|