getwd()

get path name of current working directory 

Function


SYNOPSIS

#include <unistd.h>

char *getwd(char *path_name);


DESCRIPTION

The getwd() function determines an absolute path name of the current working directory of the calling process, and copies that path name into the array pointed to by the path_name argument.


PARAMETERS

path_name 

Points to the buffer that is to hold the returned path.


RETURN VALUES

Upon successful completion, a pointer to the string containing the absolute path name of the current working directory is returned. Otherwise, getwd() returns a null pointer and the contents of the array pointed to by path_name are undefined.

If the length of the path name of the current working directory is greater than PATH_MAX+1 including the null byte, getwd() fails and returns a null pointer.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

Use getcwd(). Use one of the _NutPathTo() family of functions to convert the returned path.

Path names are returned as multibyte sequences and are converted from Unicode (UTF-16) before returning from Win32. The conversion is either performed based on the current thread locale, set using uselocale() or the process locale as set by a call to setlocale(), and overridden by _NutConf() _NC_SET_ANSI_LOCALE and _NC_SET_UTF8_LOCALE options. Under all other conditions, the multibyte sequences are considered to be from the ANSI code page for the current windows system locale.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
_NutPathToNutc(), _NutPathToWin32(), _NutPathToWin32FS(), getcwd(), xlocale()


PTC MKS Toolkit 10.3 Documentation Build 39.