3 #include "stdio_impl.h"
7 char *__randname(char *);
11 char s[] = "/tmp/tmpfile_XXXXXX";
15 for (try=0; try<MAXTRIES; try++) {
17 fd = sys_open(s, O_RDWR|O_CREAT|O_EXCL, 0600);
20 __syscall(SYS_unlink, s);
22 __syscall(SYS_unlinkat, AT_FDCWD, s, 0);
24 f = __fdopen(fd, "w+");
25 if (!f) __syscall(SYS_close, fd);