summaryrefslogtreecommitdiff
path: root/src/stdio/tmpfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/tmpfile.c')
-rw-r--r--src/stdio/tmpfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c
index c8569948..a7d0000a 100644
--- a/src/stdio/tmpfile.c
+++ b/src/stdio/tmpfile.c
@@ -17,7 +17,11 @@ FILE *tmpfile(void)
fd = sys_open(s, O_RDWR|O_CREAT|O_EXCL, 0600);
if (fd >= 0) {
f = __fdopen(fd, "w+");
+#ifdef SYS_unlink
__syscall(SYS_unlink, s);
+#else
+ __syscall(SYS_unlinkat, AT_FDCWD, s, 0);
+#endif
return f;
}
}