_ggeettwwdd() -- General Function (libc)

Get current working directory name
cchhaarr *_ggeettwwdd(_p_a_t_h_n_a_m_e)
cchhaarr *_p_a_t_h_n_a_m_e;

The  _c_u_r_r_e_n_t  _w_o_r_k_i_n_g  _d_i_r_e_c_t_o_r_y is  the  directory  from  which file  name
searches  commence when  a path  name  does not  begin with  `/'.  _ggeettwwdd()
returns  the name  of  the current  working  directory.  It  is useful  for
processes like  spoolers and daemons,  which must generate  full path names
for files.

If  you do  not  have permission  to  search all  levels  of the  directory
hierarchy above the current directory, _ggeettwwdd() cannot obtain the directory
name for you.

_S_e_e _A_l_s_o
cchhddiirr(), ggeettccwwdd(), lliibbcc, ppwwdd

_D_i_a_g_n_o_s_t_i_c_s
_ggeettwwdd() returns NULL and writes an error message into _p_a_t_h_n_a_m_e if an error
occurs, e.g.,  if the  current directory  cannot be found  or if  any other
error occurs.

_N_o_t_e_s
_ggeettwwdd()  is  obsolete,  and  is  included  for reasons  of  compatibility.
Programmers should use the function ggeettccwwdd() instead.

_ggeettwwdd()  fails  if  the current  directory  name  is  longer than  MAXPATH
characters (128  characters as defined in header  file <ppaatthh.hh>). The chunk
of memory  pointed to  by _p_a_t_h_n_a_m_e  must be big  enough to  hold MMAAXXPPAATTHHLLEENN
characters plus a trailing NUL.

If _ggeettwwdd() fails, the working  directory cannot be restored to its initial
value.

The name  of this function has  been change to _ggeettwwdd()  to avoid confusion
with  the Berkeley  UNIX function  ggeettwwdd(), which  has a  different calling
sequence.
