Changes the current working directory of the thread to the specified directory.
#include <fsio.h> int chdir2 ( const char *path);
(IN) Specifies the buffer containing the directory path.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The chdir2 function causes the directory named by the path parameter to become the current working directory for the calling thread. It doesn't affect the current working directory of other threads in the VM. This functionality allows one or more threads to operate independently of each other in a same VM, which might be convenient for an application serving diverse client requests.
Any subsequent call to chdir after calling chrdir2 by this thread affects the current working directory of all threads in the VM, except this thread. This thread retains the current working directory established by chdir2.
If the path parameter points to a NULL string, this signals the end of thread-specific use of the current working directory, and the thread returns to the normal, per-VM state of calculating the current working directory.
The chrdir2 function was created for use by the server applications with the following characteristics:
Represent or proxy several clients
Each client has its own thread
Each client has its own unique current working directory, which makes calls to chdir highly inconvenient.