]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/tmpnam.3.patch
Libc-594.1.4.tar.gz
[apple/libc.git] / stdio / FreeBSD / tmpnam.3.patch
1 --- tmpnam.3.orig 2008-11-13 16:39:10.000000000 -0800
2 +++ tmpnam.3 2008-11-13 16:45:15.000000000 -0800
3 @@ -36,7 +36,7 @@
4 .\" @(#)tmpnam.3 8.2 (Berkeley) 11/17/93
5 .\" $FreeBSD: src/lib/libc/stdio/tmpnam.3,v 1.16 2004/06/21 19:38:25 mpp Exp $
6 .\"
7 -.Dd November 17, 1993
8 +.Dd November 12, 2008
9 .Dt TMPFILE 3
10 .Os
11 .Sh NAME
12 @@ -49,11 +49,18 @@
13 .Sh SYNOPSIS
14 .In stdio.h
15 .Ft FILE *
16 -.Fn tmpfile void
17 +.Fo tmpfile
18 +.Fa void
19 +.Fc
20 .Ft char *
21 -.Fn tmpnam "char *str"
22 +.Fo tmpnam
23 +.Fa "char *s"
24 +.Fc
25 .Ft char *
26 -.Fn tempnam "const char *tmpdir" "const char *prefix"
27 +.Fo tempnam
28 +.Fa "const char *dir"
29 +.Fa "const char *pfx"
30 +.Fc
31 .Sh DESCRIPTION
32 The
33 .Fn tmpfile
34 @@ -67,12 +74,13 @@
35 reference to it is closed.
36 The file is opened with the access value
37 .Ql w+ .
38 -The file is created in the directory determined by the environment variable
39 +If the environment variable
40 .Ev TMPDIR
41 -if set.
42 -The default location if
43 +is defined,
44 +the file is created in the specified directory.
45 +The default location, if
46 .Ev TMPDIR
47 -is not set is
48 +is not set, is
49 .Pa /tmp .
50 .Pp
51 The
52 @@ -87,7 +95,7 @@
53 is defined in the include file
54 .In stdio.h .
55 If the argument
56 -.Fa str
57 +.Fa s
58 is
59 .Pf non- Dv NULL ,
60 the file name is copied to the buffer it references.
61 @@ -97,7 +105,7 @@
62 returns a pointer to the file name.
63 .Pp
64 The buffer referenced by
65 -.Fa str
66 +.Fa s
67 is expected to be at least
68 .Dv L_tmpnam
69 bytes in length.
70 @@ -113,21 +121,23 @@
71 but provides the ability to specify the directory which will
72 contain the temporary file and the file name prefix.
73 .Pp
74 -The environment variable
75 -.Ev TMPDIR
76 -(if set), the argument
77 -.Fa tmpdir
78 +The argument
79 +.Fa dir
80 (if
81 .Pf non- Dv NULL ) ,
82 the directory
83 .Dv P_tmpdir ,
84 -and the directory
85 +the environment variable
86 +.Ev TMPDIR
87 +(if set),
88 +the directory
89 .Pa /tmp
90 +and finally, the current directory,
91 are tried, in the listed order, as directories in which to store the
92 temporary file.
93 .Pp
94 The argument
95 -.Fa prefix ,
96 +.Fa pfx ,
97 if
98 .Pf non- Dv NULL ,
99 is used to specify a file name prefix, which will be the
100 @@ -226,14 +236,15 @@
101 interface should not be used in software expected to be used on other systems
102 if there is any possibility that the user does not wish the temporary file to
103 be publicly readable and writable.
104 +.Sh LEGACY DESCRIPTION
105 +In legacy mode, the order directories are tried by the
106 +.Fn tempnam
107 +function is different; the environment variable
108 +.Ev TMPDIR
109 +(if defined) is used first.
110 .Sh SEE ALSO
111 .Xr mkstemp 3 ,
112 .Xr mktemp 3
113 -.Rs
114 -.%T "The FreeBSD Security Architecture"
115 -.Re
116 -(See
117 -.Pa "/usr/share/doc/{to be determined}" . )
118 .Sh STANDARDS
119 The
120 .Fn tmpfile