#define freopen(__file, __mode, __fp) __fopen((__file), -1, (__fp), (__mode))
#define fdopen(__file, __mode) __fopen((char*)0, (__file), (FILE*)0, (__mode))
+extern FILE *tmpfile __P((void));
+
extern int fputs __P((const void *, FILE*));
extern int puts __P((const void *));
extern long strtol __P ((const char * nptr, char ** endptr, int base));
extern unsigned long strtoul __P ((const char * nptr,
char ** endptr, int base));
+
+extern int mkstemp(char *template);
+extern int mkstemps(char *template, int suffix);
+
#ifndef __HAS_NO_DOUBLES__
extern double strtod __P ((const char * nptr, char ** endptr));
#endif
SRC_C += stat.c stdio0.c stime.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c
-SRC_C += strtod.c strtol.c system.c time.c tmpnam.c ttyname.c
+SRC_C += strtod.c strtol.c system.c time.c tmpfile.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c
SRC_C += stat.c stdio0.c stime.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
SRC_C += strnicmp.c strnlen.c strsep.c
-SRC_C += system.c time.c tmpnam.c ttyname.c
+SRC_C += system.c time.c tmpfile.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+FILE *tmpfile(void)
+{
+ int fd = mkstemp("/tmp/tmpfileXXXXXX");
+ if (fd == -1)
+ return;
+ return fdopen(fd, "r+");
+}
+