.\" Copyright (c) 1999 Andries Brouwer (aeb@cwi.nl)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH TEMPNAM 3 2008-08-06 "" "Linux Programmer's Manual"
+.TH TEMPNAM 3 2014-02-27 "" "Linux Programmer's Manual"
.SH NAME
tempnam \- create a name for a temporary file
.SH SYNOPSIS
.BR tempnam ():
_BSD_SOURCE || _SVID_SOURCE
.SH DESCRIPTION
+.I "Never use this function."
+Use
+.BR mkstemp (3)
+or
+.BR tmpfile (3)
+instead.
+
The
.BR tempnam ()
function returns a pointer to a string that is a valid filename,
.BR malloc (3)
and hence should be freed by
.BR free (3).
-.SH "RETURN VALUE"
-The
+.SH RETURN VALUE
+On success, the
.BR tempnam ()
-function returns a pointer to a unique temporary
-filename, or NULL if a unique name cannot be generated.
+function returns a pointer to a unique temporary filename.
+It returns NULL if a unique name cannot be generated, with
+.I errno
+set to indicate the cause of the error.
.SH ERRORS
.TP
.B ENOMEM
Allocation of storage failed.
-.SH "CONFORMING TO"
+.SH CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
POSIX.1-2008 marks
.BR tempnam ()
.SH BUGS
The precise meaning of "appropriate" is undefined;
it is unspecified how accessibility of a directory is determined.
-
-Never use this function.
-Use
-.BR mkstemp (3)
-or
-.BR tmpfile (3)
-instead.
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR mkstemp (3),
.BR mktemp (3),
.BR tmpfile (3),
.BR tmpnam (3)
+.SH COLOPHON
+This page is part of release 3.65 of the Linux
+.I man-pages
+project.
+A description of the project,
+and information about reporting bugs,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.