4 #include "stdio_impl.h"
10 char s[] = "/tmp/tmpfile_XXXXXX";
14 for (try=0; try<MAXTRIES; try++) {
16 fd = sys_open(s, O_RDWR|O_CREAT|O_EXCL, 0600);
19 __syscall(SYS_unlink, s);
21 __syscall(SYS_unlinkat, AT_FDCWD, s, 0);
23 f = __fdopen(fd, "w+");
24 if (!f) __syscall(SYS_close, fd);
31 weak_alias(tmpfile, tmpfile64);