]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/tmpnam.3.patch
Libc-763.12.tar.gz
[apple/libc.git] / stdio / FreeBSD / tmpnam.3.patch
1 --- tmpnam.3.bsdnew 2009-11-11 13:33:17.000000000 -0800
2 +++ tmpnam.3 2009-11-11 15:17:16.000000000 -0800
3 @@ -32,7 +32,7 @@
4 .\" @(#)tmpnam.3 8.2 (Berkeley) 11/17/93
5 .\" $FreeBSD: src/lib/libc/stdio/tmpnam.3,v 1.20 2007/03/16 21:46:24 maxim Exp $
6 .\"
7 -.Dd March 18, 2007
8 +.Dd November 12, 2008
9 .Dt TMPFILE 3
10 .Os
11 .Sh NAME
12 @@ -45,11 +45,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 @@ -63,12 +70,13 @@ returns, causing the file to be automati
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 @@ -83,7 +91,7 @@ past.
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 @@ -93,7 +101,7 @@ In either case,
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 @@ -109,21 +117,23 @@ is similar to
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 @@ -235,6 +245,12 @@ It is strongly suggested that
101 be used in place of these functions.
102 (See
103 the FSA.)
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