extern char *TESTDIR;
DESCRIPTIONThe tst_tmpdir() function uses the first three characters of the TCID global variable as the prefix in forming a unique directory name (via tempnam(3S)). The directory is then created and made the current working directory.
If tst_tmpdir() cannot form a unique directory name, create the directory, or chdir to the directory, it uses tst_brk() to issue "BROK" messages for all test cases. It then exits via tst_exit(). Because tst_tmpdir() exits in the event of a problem, a test must call it before performing any operations that would require running a cleanup routine.
The tst_rmdir() function recursively removes the directory created by tst_tmpdir(). This function should be used only as a companion to tst_tmpdir() and should be called immediately prior to the test exiting via tst_exit().
Users may gain access to the name of the temporary directory by declaring the external character pointer TESTDIR.