Loading...
stdio/mktemp.3 Libc-763.13 Libc-262.3.2
--- Libc/Libc-763.13/stdio/mktemp.3
+++ Libc/Libc-262.3.2/stdio/mktemp.3
@@ -9,6 +9,10 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"	This product includes software developed by the University of
+.\"	California, Berkeley and its contributors.
 .\" 4. Neither the name of the University nor the names of its contributors
 .\"    may be used to endorse or promote products derived from this software
 .\"    without specific prior written permission.
@@ -26,15 +30,12 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)mktemp.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdio/mktemp.3,v 1.22 2007/01/09 00:28:07 imp Exp $
+.\" $FreeBSD: src/lib/libc/stdio/mktemp.3,v 1.17 2001/10/01 16:08:59 ru Exp $
 .\"
 .Dd February 11, 1998
 .Dt MKTEMP 3
 .Os
 .Sh NAME
-.Nm mkdtemp ,
-.Nm mkstemp ,
-.Nm mkstemps ,
 .Nm mktemp
 .Nd make temporary file name (unique)
 .Sh LIBRARY
@@ -42,23 +43,13 @@
 .Sh SYNOPSIS
 .In unistd.h
 .Ft char *
-.Fo mkdtemp
-.Fa "char *template"
-.Fc
+.Fn mktemp "char *template"
 .Ft int
-.Fo mkstemps
-.Fa "char *template"
-.Fa "int suffixlen"
-.Fc
-.In stdlib.h
+.Fn mkstemp "char *template"
 .Ft int
-.Fo mkstemp
-.Fa "char *template"
-.Fc
+.Fn mkstemps "char *template" "int suffixlen"
 .Ft char *
-.Fo mktemp
-.Fa "char *template"
-.Fc
+.Fn mkdtemp "char *template"
 .Sh DESCRIPTION
 The
 .Fn mktemp
@@ -103,15 +94,13 @@
 except it permits a suffix to exist in the template.
 The template should be of the form
 .Pa /tmp/tmpXXXXXXsuffix .
-The
-.Fn mkstemps
-function
+.Fn mkstemps
 is told the length of the suffix string.
 .Pp
 The
 .Fn mkdtemp
 function makes the same replacement to the template as in
-.Fn mktemp
+.Xr mktemp 3
 and creates the template directory, mode 0700.
 .Sh RETURN VALUES
 The
@@ -146,7 +135,7 @@
 .Pp
 The
 .Fn mkstemp ,
-.Fn mkstemps ,
+.Fn mkstemps
 and
 .Fn mkdtemp
 functions
@@ -180,7 +169,7 @@
 passes in a read-only string to
 .Fn mktemp ,
 .Fn mkstemp ,
-.Fn mkstemps ,
+.Fn mkstemps
 or
 .Fn mkdtemp .
 This is common with programs that were developed before
@@ -199,40 +188,6 @@
 See
 .Xr gcc 1
 for more information.
-.Sh LEGACY SYNOPSIS
-.Fd #include <unistd.h>
-.Pp
-The include file
-.In unistd.h
-is necessary and sufficient for all functions.
-.Sh SEE ALSO
-.Xr chmod 2 ,
-.Xr getpid 2 ,
-.Xr mkdir 2 ,
-.Xr open 2 ,
-.Xr stat 2 ,
-.Xr compat 5
-.Sh HISTORY
-A
-.Fn mktemp
-function appeared in
-.At v7 .
-The
-.Fn mkstemp
-function appeared in
-.Bx 4.4 .
-The
-.Fn mkdtemp
-function first appeared in
-.Ox 2.2 ,
-and later in
-.Fx 3.2 .
-The
-.Fn mkstemps
-function first appeared in
-.Ox 2.4 ,
-and later in
-.Fx 3.4 .
 .Sh BUGS
 This family of functions produces filenames which can be guessed,
 though the risk is minimized when large numbers of
@@ -262,3 +217,30 @@
 This will ensure that the program does not continue blindly
 in the event that an attacker has already created the file
 with the intention of manipulating or reading its contents.
+.Sh SEE ALSO
+.Xr chmod 2 ,
+.Xr getpid 2 ,
+.Xr mkdir 2 ,
+.Xr open 2 ,
+.Xr stat 2
+.Sh HISTORY
+A
+.Fn mktemp
+function appeared in
+.At v7 .
+The
+.Fn mkstemp
+function appeared in
+.Bx 4.4 .
+The
+.Fn mkdtemp
+function first appeared in
+.Ox 2.2 ,
+and later in
+.Fx 3.2 .
+The
+.Fn mkstemps
+function first appeared in
+.Ox 2.4 ,
+and later in
+.Fx 3.4 .