123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #include <features.h>
- #include <stdio.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include "../misc/internals/tempname.h"
- #include <not-cancel.h>
- FILE * tmpfile (void)
- {
- char buf[FILENAME_MAX];
- int fd;
- FILE *f;
- if (__path_search (buf, FILENAME_MAX, NULL, "tmpf", 0))
- return NULL;
- fd = __gen_tempname (buf, __GT_FILE, 0, 0, S_IRUSR | S_IWUSR);
- if (fd < 0)
- return NULL;
-
- (void) remove (buf);
- if ((f = fdopen (fd, "w+b")) == NULL)
- close_not_cancel (fd);
- return f;
- }
- strong_alias(tmpfile,tmpfile64)
|