The mkstemp() function generates a unique temporary file name from
template. The last six characters of template must be XXXXXX and
these are replaced with a string that makes the filename unique. The file is
then created with mode read/write and permissions 0666 (glibc 2.0.6 and
earlier), 0600 (glibc 2.0.7 and later). Since it will be modified,
template must not be a string constant, but should be declared as a
character array. The file is opened with the O_EXCL flag, guaranteeing that
when mkstemp returns successfully we are the only user.