Provided by: ltp-dev_20091231+dfsg-1ubuntu2_amd64 bug


       tst_tmpdir - create a unique testing directory and make it current.
       tst_rmdir - remove the directory created by tst_tmpdir.


       void tst_tmpdir()

       void tst_rmdir()

       extern char *TESTDIR;


       The  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().

       tst_rmdir() uses the system(3S) library routine (which in turn calls  fork(2)),  so  tests
       that use it cannot treat SIGCLD as an unexpected signal.

       Users  may  gain  access  to the name of the temporary directory by declaring the external
       character pointer TESTDIR.


       The tst_rmdir() function will check the TESTDIR global variable to ensure that the user is
       not  attempting  to  remove  the root directory or some unspecified directories with a "*"
       parameter.  All error/warning messages are delivered through tst_res().


       fork(2), system(3S), tst_res(3), tmpnam(3S).