]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/mktemp.3.patch
Libc-763.12.tar.gz
[apple/libc.git] / stdio / FreeBSD / mktemp.3.patch
1 --- mktemp.3.orig 2010-04-28 23:38:47.000000000 -0700
2 +++ mktemp.3 2010-04-29 11:05:28.000000000 -0700
3 @@ -32,6 +32,9 @@
4 .Dt MKTEMP 3
5 .Os
6 .Sh NAME
7 +.Nm mkdtemp ,
8 +.Nm mkstemp ,
9 +.Nm mkstemps ,
10 .Nm mktemp
11 .Nd make temporary file name (unique)
12 .Sh LIBRARY
13 @@ -39,13 +42,23 @@
14 .Sh SYNOPSIS
15 .In unistd.h
16 .Ft char *
17 -.Fn mktemp "char *template"
18 +.Fo mkdtemp
19 +.Fa "char *template"
20 +.Fc
21 .Ft int
22 -.Fn mkstemp "char *template"
23 +.Fo mkstemps
24 +.Fa "char *template"
25 +.Fa "int suffixlen"
26 +.Fc
27 +.In stdlib.h
28 .Ft int
29 -.Fn mkstemps "char *template" "int suffixlen"
30 +.Fo mkstemp
31 +.Fa "char *template"
32 +.Fc
33 .Ft char *
34 -.Fn mkdtemp "char *template"
35 +.Fo mktemp
36 +.Fa "char *template"
37 +.Fc
38 .Sh DESCRIPTION
39 The
40 .Fn mktemp
41 @@ -133,7 +146,7 @@ The pathname portion of the template is
42 .Pp
43 The
44 .Fn mkstemp ,
45 -.Fn mkstemps
46 +.Fn mkstemps ,
47 and
48 .Fn mkdtemp
49 functions
50 @@ -167,7 +180,7 @@ A common problem that results in a core
51 passes in a read-only string to
52 .Fn mktemp ,
53 .Fn mkstemp ,
54 -.Fn mkstemps
55 +.Fn mkstemps ,
56 or
57 .Fn mkdtemp .
58 This is common with programs that were developed before
59 @@ -186,12 +199,19 @@ so that it will store string constants i
60 See
61 .Xr gcc 1
62 for more information.
63 +.Sh LEGACY SYNOPSIS
64 +.Fd #include <unistd.h>
65 +.Pp
66 +The include file
67 +.In unistd.h
68 +is necessary and sufficient for all functions.
69 .Sh SEE ALSO
70 .Xr chmod 2 ,
71 .Xr getpid 2 ,
72 .Xr mkdir 2 ,
73 .Xr open 2 ,
74 -.Xr stat 2
75 +.Xr stat 2 ,
76 +.Xr compat 5
77 .Sh HISTORY
78 A
79 .Fn mktemp
80 @@ -242,10 +262,3 @@ and the return status of the call should
81 This will ensure that the program does not continue blindly
82 in the event that an attacker has already created the file
83 with the intention of manipulating or reading its contents.
84 -.Pp
85 -The implementation of these functions calls
86 -.Xr arc4random 3 ,
87 -which is not reentrant.
88 -You must provide your own locking around this and other consumers of the
89 -.Xr arc4random 3
90 -API.