GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TST_TMPDIR(3) FreeBSD Library Functions Manual TST_TMPDIR(3)

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 SIGCHLD 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_resm().

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

07/25/2000 Linux Test Project

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.