mktemp

The mktemp() function returns a file name that is guaranteed to be unique on the Policy Server host.

result = mktemp (template);
template Required. Character string that contains a file name template. Within template, characters forming a unique identifier replace six trailing X characters. Many, but not all, user systems require precisely six X characters, which must be the trailing characters. Five X character ss, or X character ss in the middle of a template, might work on some systems, but this behavior is not guaranteed

result contains the generated file name. If a unique file name cannot be generated from template, result contains a blank character string ("").

In the example,

result = mktemp ("/var/adm/iologXXXXXX");

result contains the file name /var/adm/iolog.XXXXXX, where XXXXXX is replaced by a unique identifier that is generated by the operating system.

In order to have an I/O log created in this manner, the iolog variable must be set to the result of logmktemp(). For example:
iolog = logmktemp("/var/adm/iolog.XXXXXX");
logmktemp(), stat()