aboutsummaryrefslogtreecommitdiffstats
path: root/man3/tmpnam.3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-04-12 22:42:49 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-04-12 22:42:49 +0000
commitc13182efa3b3d77f2563034c8212c0ca798243ca (patch)
treee7652b26018b7c22cd6a4e4b41404dfaab911303 /man3/tmpnam.3
parent4174ff5658082832c2ed511720f18881b3a80a34 (diff)
downloadman-pages-c13182efa3b3d77f2563034c8212c0ca798243ca.tar.gz
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
white space.
Diffstat (limited to 'man3/tmpnam.3')
-rw-r--r--man3/tmpnam.326
1 files changed, 15 insertions, 11 deletions
diff --git a/man3/tmpnam.3 b/man3/tmpnam.3
index 597562501d..46e0234207 100644
--- a/man3/tmpnam.3
+++ b/man3/tmpnam.3
@@ -8,7 +8,7 @@
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
-.\"
+.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
@@ -16,7 +16,7 @@
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
-.\"
+.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
@@ -37,7 +37,8 @@ The
function returns a pointer to a string that is a valid filename,
and such that a file with this name did not exist at some point
in time, so that naive programmers may think it
-a suitable name for a temporary file. If the argument
+a suitable name for a temporary file.
+If the argument
.I s
is NULL this name is generated in an internal static buffer
and may be overwritten by the next call to
@@ -65,7 +66,7 @@ just like the TMP_MAX mentioned below.)
.SH "RETURN VALUE"
The
.BR tmpnam ()
-function returns a pointer to a unique temporary
+function returns a pointer to a unique temporary
filename, or NULL if a unique name cannot be generated.
.SH ERRORS
No errors are defined.
@@ -73,23 +74,25 @@ No errors are defined.
The
.BR tmpnam ()
function generates a different string each time it is called,
-up to TMP_MAX times. If it is called more than TMP_MAX times,
+up to TMP_MAX times.
+If it is called more than TMP_MAX times,
the behaviour is implementation defined.
.LP
-Although
+Although
.BR tmpnam (3)
generates names that are difficult to guess,
it is nevertheless possible that between the time that
.BR tmpnam (3)
returns a pathname, and the time that the program opens it,
another program might create that pathname using
-.BR open (2),
+.BR open (2),
or create it as a symbolic link.
This can lead to security holes.
-To avoid such possibilities, use the
+To avoid such possibilities, use the
.BR open (2)
.B O_EXCL
-flag to open the pathname. Or better yet, use
+flag to open the pathname.
+Or better yet, use
.BR mkstemp (3)
or
.BR tmpfile (3).
@@ -114,12 +117,13 @@ tmpnam_r(char *s)
.fi
.sp
apparently as a warning not to use NULL.
-A few systems implement it.
+A few systems implement it.
To get a glibc prototype for this function,
define _SVID_SOURCE or _BSD_SOURCE before including
.IR "<stdio.h>" .
.SH BUGS
-Never use this function. Use
+Never use this function.
+Use
.BR mkstemp (3)
or
.BR tmpfile (3)