-\fIMktemp\fP creates a unique file name and returns the address of
-the template. The template should contain a file name with trailing
-\fIX\fP's, normally something like \fI/tmp/tempXXXXXX\fP. The \fIX\fP's
-are replaced by the current process number and/or a unique letter
-combination. \fIMkstemp\fP makes the same replacement to the template
-but creates the template file, mode 0600, and returns a file descriptor
-open for reading and writing. \fIMkstemp\fP avoids the race between testing
-whether the file exists and opening it for use. The number of file
-name combinations \fImktemp\fP and \fImkstemp\fP will try depends on
-the number of \fIX\fP's placed on the end of the template; six \fIX\fP's
-will result in them trying roughly 26 ** 6 combinations.
+.I Mktemp
+takes a file name template and overwrites it to create a unique file
+name for use by the application.
+The template may be any file name with some number of X's appended
+to it, for example ``/tmp/temp.XXXX''.
+The trailing X's are replaced with the current process number and/or a
+unique letter combination.
+The number of unique file names
+.I mktemp
+can return depends on the number of X's provided; six X's will
+result in
+.I mktemp
+testing roughly 26 ** 6 combinations.
+.PP
+.I Mkstemp
+makes the same replacement to the template and creates the template file,
+mode 0600, returning a file descriptor opened for reading and writing.
+This avoids the race between testing for a file's existence and opening it
+for use.
+.PP
+.I Mktemp
+returns a pointer to the template on success and NULL on failure.
+.I Mkstemp
+returns -1 if no suitable file could be created.
+.SH ERRORS
+.I Mktemp
+and
+.I mkstemp
+may set
+.I errno
+to one of the following values:
+.TP
+[ENOTDIR]
+The pathname portion of the template is not an existing directory.
+.PP
+.I Mktemp
+and
+.I mkstemp
+may also set
+.I errno
+to any value specified by the
+.IR stat (2)
+function.
+.I Mkstemp
+may also set
+.I errno
+to any value specified by the
+.IR open (2)
+function.