document sticky EOF
[unix-history] / usr / src / lib / libc / stdio / mktemp.3
CommitLineData
78396556 1.\" @(#)mktemp.3 6.1 (Berkeley) %G%
93138961 2.\"
78396556 3.TH MKTEMP 3 ""
93138961
KM
4.AT 3
5.SH NAME
6mktemp \- make a unique file name
7.SH SYNOPSIS
8.nf
9.B char *mktemp(template)
10.B char *template;
78396556
KM
11.sp
12.B mkstemp(template)
13.B char *template;
93138961
KM
14.fi
15.SH DESCRIPTION
16.I Mktemp
17replaces
18.I template
19by a unique file name, and returns the
20address of the template.
21The template should look like a file name with six trailing
22X's, which will be replaced with the
23current process id and a unique letter.
78396556
KM
24.I Mkstemp
25makes the same replacement to the template but returns an open file descriptor
26for the template file suitable for reading or writing.
27.I Mkstemp
28avoids the potential race between the creation of the unique
29file name and its being opened for use.
93138961
KM
30.SH "SEE ALSO"
31getpid(2)