ref: 95552e35a889ea98c511ffc72ebc62d9fd48121a
dir: /src/libc/arch/posix/tmpfile.c/
#include <stdio.h> #include "../../syscall.h" #undef tmpfile FILE * tmpfile(void) { char *fname; FILE *fp; for (;;) { if ((fname = tmpnam(NULL)) == NULL) return NULL; if ((fp = fopen(fname, "wt+")) == NULL) continue; _unlink(fname); return fp; } }