Loading...
--- Libc/Libc-498/stdio/mktemp.3
+++ Libc/Libc-262.3.2/stdio/mktemp.3
@@ -30,39 +30,26 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mktemp.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdio/mktemp.3,v 1.20 2004/02/20 04:08:28 green 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 mktemp ,
-.Nm mktemps
+.Nm mktemp
.Nd make temporary file name (unique)
.Sh LIBRARY
.Lb libc
.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
@@ -107,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
@@ -150,7 +135,7 @@
.Pp
The
.Fn mkstemp ,
-.Fn mkstemps ,
+.Fn mkstemps
and
.Fn mkdtemp
functions
@@ -184,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
@@ -232,26 +217,12 @@
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.
-.Pp
-The implementation of these functions calls
-.Xr arc4random 3 ,
-which is not reentrant.
-You must provide your own locking around this and other consumers of the
-.Xr arc4random 3
-API.
-.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
+.Xr stat 2
.Sh HISTORY
A
.Fn mktemp