Loading...
stdio/tmpnam.3 Libc-498 Libc-583
--- Libc/Libc-498/stdio/tmpnam.3
+++ Libc/Libc-583/stdio/tmpnam.3
@@ -36,7 +36,7 @@
 .\"     @(#)tmpnam.3	8.2 (Berkeley) 11/17/93
 .\" $FreeBSD: src/lib/libc/stdio/tmpnam.3,v 1.16 2004/06/21 19:38:25 mpp Exp $
 .\"
-.Dd November 17, 1993
+.Dd November 12, 2008
 .Dt TMPFILE 3
 .Os
 .Sh NAME
@@ -121,16 +121,18 @@
 but provides the ability to specify the directory which will
 contain the temporary file and the file name prefix.
 .Pp
-The environment variable
-.Ev TMPDIR
-(if set), the argument
+The argument
 .Fa dir
 (if
 .Pf non- Dv NULL ) ,
 the directory
 .Dv P_tmpdir ,
-and the directory
+the environment variable
+.Ev TMPDIR
+(if set),
+the directory
 .Pa /tmp
+and finally, the current directory,
 are tried, in the listed order, as directories in which to store the
 temporary file.
 .Pp
@@ -234,6 +236,12 @@
 interface should not be used in software expected to be used on other systems
 if there is any possibility that the user does not wish the temporary file to
 be publicly readable and writable.
+.Sh LEGACY DESCRIPTION
+In legacy mode, the order directories are tried by the
+.Fn tempnam
+function is different; the environment variable
+.Ev TMPDIR
+(if defined) is used first.
 .Sh SEE ALSO
 .Xr mkstemp 3 ,
 .Xr mktemp 3