GETWD(3C) Standard C Library Functions GETWD(3C) NNAAMMEE ggeettwwdd -- get current working directory pathname SSYYNNOOPPSSIISS ##iinncclluuddee <> _c_h_a_r _* ggeettwwdd(_c_h_a_r _*_p_a_t_h___n_a_m_e); DDEESSCCRRIIPPTTIIOONN The ggeettwwdd() function determines an absolute pathname of the current working directory of the calling process, and copies that pathname into the array pointed to by the _p_a_t_h___n_a_m_e argument. If the length of the pathname of the current working directory is greater than (PATH_MAX + 1) including the null byte, ggeettwwdd() fails and returns a null pointer. RREETTUURRNN VVAALLUUEESS Upon successful completion, a pointer to the string containing the absolute pathname of the current working directory is returned. Otherwise, ggeettwwdd() returns a null pointer and the contents of the array pointed to by _p_a_t_h___n_a_m_e are undefined. EERRRROORRSS No errors are defined. UUSSAAGGEE The ggeettwwdd() function is supplied for backwards compatibility. The getcwd(3C) should be used instead. IINNTTEERRFFAACCEE SSTTAABBIILLIITTYY OObbssoolleettee SSttaannddaarrdd. SSEEEE AALLSSOO getcwd(3C), standards(5) SSTTAANNDDAARRDDSS The ggeettwwdd() function is available in the following compilation environments. See standards(5). oo X/Open Portability Guide Issue 4, Version 2 (``XPG4.2'') oo Version 2 of the Single UNIX Specification (``SUSv2'') oo Version 3 of the Single UNIX Specification (``SUSv3'') It was marked obsolete in Version 3 of the Single UNIX Specification (``SUSv3'') and removed from IEEE Std 1003.1-2008 (``POSIX.1''). illumos March 30, 2015 illumos