mkstemp(3C) SDK R4.11 mkstemp(3C)
NAME
mkstemp - make a unique file name
SYNOPSIS
mkstemp(template)
char *template;
DESCRIPTION
Mkstemp creates a unique file name, typically in a temporary
filesystem, by replacing template with a unique file name and
returning a file descriptor for the template file open for reading
and writing. The template should contain a file name with six
trailing X's, which are replaced with the current process id and a
unique letter. Mkstemp avoids the race between testing whether the
file exists and opening it for use.
DIAGNOSTICS
Mkstemp returns an open file descriptor upon success. It returns -1
if no suitable file could be created.
SEE ALSO
getpid(2), open(2).
Licensed material--property of copyright holder(s)