summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-05 10:43:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-05 10:43:17 -0600
commite76eef31375dcbea0e05b971b646f14893041046 (patch)
tree600f246391112b193dd8c2148ceeb3280e26af45 /nuttx/include
parent242d5e18ce594dab9ed6777fd7cde7e9dae4c99f (diff)
downloadpx4-nuttx-e76eef31375dcbea0e05b971b646f14893041046.tar.gz
px4-nuttx-e76eef31375dcbea0e05b971b646f14893041046.tar.bz2
px4-nuttx-e76eef31375dcbea0e05b971b646f14893041046.zip
Add tmpnam() and tempnam()
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/stdio.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/nuttx/include/stdio.h b/nuttx/include/stdio.h
index bc0164aa4..cb1636679 100644
--- a/nuttx/include/stdio.h
+++ b/nuttx/include/stdio.h
@@ -78,6 +78,26 @@
#define getchar() fgetc(stdin)
#define rewind(s) ((void)fseek((s),0,SEEK_SET))
+/* Path to the directory where temporary files can be created */
+
+#ifndef CONFIG_LIBC_TMPDIR
+# define CONFIG_LIBC_TMPDIR "/tmp"
+#endif
+
+#define P_tmpdir CONFIG_LIBC_TMPDIR
+
+/* Maximum size of character array to hold tmpnam() output. */
+
+#ifndef CONFIG_LIBC_MAX_TMPFILE
+# define CONFIG_LIBC_MAX_TMPFILE 32
+#endif
+
+#define L_tmpnam CONFIG_LIBC_MAX_TMPFILE
+
+/* the maximum number of unique temporary file names that can be generated */
+
+#define TMP_MAX 56800235584ull
+
/****************************************************************************
* Public Type Definitions
****************************************************************************/
@@ -161,6 +181,8 @@ int vdprintf(int fd, FAR const char *fmt, va_list ap);
/* Operations on paths */
int statfs(FAR const char *path, FAR struct statfs *buf);
+FAR char *tmpnam(FAR char *s);
+FAR char *tempnam(FAR const char *dir, FAR const char *pfx);
#undef EXTERN
#if defined(__cplusplus)