Table of Contents

NAME

SYNOPSIS

DESCRIPTION

The function copies the absolute pathname of the current working directory into the memory referenced by and returns a pointer to The argument is the size, in bytes, of the array referenced by If is space is allocated as necessary to store the pathname. This space may later be The function is a compatibility routine which calls with its argument and a size of (as defined in the include file Obviously, should be at least bytes in length. These routines have traditionally been used by programs to save the name of a working directory for the purpose of returning to it. A much faster and less error-prone method of accomplishing this is to open the current directory and use the function to return.

RETURN VALUES

Upon successful completion, a pointer to the pathname is returned. Otherwise a pointer is returned and the global variable is set to indicate the error. In addition, copies the error message associated with into the memory referenced by

ERRORS

The function will fail if: Read or search permission was denied for a component of the pathname. The argument is zero. A component of the pathname no longer exists. Insufficient memory is available. The argument is greater than zero but smaller than the length of the pathname plus 1.

SEE ALSO

STANDARDS

The function conforms to The ability to specify a pointer and have allocate memory as necessary is an extension.

HISTORY

The function appeared in

BUGS

The function does not do sufficient error checking and is not able to return very long, but valid, paths. It is provided for compatibility.


Table of Contents