* lib/mkstemp.c: Add comment.
* doc/posix-functions/mkstemp.texi (mkstemp): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
+2011-04-27 Reuben Thomas <rrt@sc3d.org>
+ and Eric Blake <eblake@redhat.com>
+
+ mkstemp: mention clean-temp module
+ * lib/mkstemp.c: Add comment.
+ * doc/posix-functions/mkstemp.texi (mkstemp): Likewise.
+
2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
inttypes: also provide default values for 32-bit tests
world or group writable or readable file, if you haven't set the process
umask to 077. This is a security risk.
@end itemize
+
+The gnulib module clean-temp can create temporary files that are less
+likely to be left behind on signals such as SIGINT.
/* Generate a unique temporary file name from XTEMPLATE.
The last six characters of XTEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique.
- Then open the file and return a fd. */
+ Then open the file and return a fd.
+
+ If you are creating temporary files which will later be removed,
+ consider using the clean-temp module, which avoids several pitfalls
+ of using mkstemp directly. */
int
mkstemp (char *xtemplate)
{