[net.unix] Getting the cwd from within a C program

dixon@ihuxa.UUCP (D. A. Dixon) (10/19/83)

If your system has the getcwd(3) library routine, then that will give
you the current working directory. If your system does not have
getcwd(3) OR you do not want to use it (because it uses popen() and 'pwd'
as noted by Guy Harris), then you can use the undocumented library routine
curdir() in libPW.a. This routine takes as an argument the address of an
array in which it can place the current directory. Since the routine is
undocumented you cannot assume it will be around in future releases of UN*X.
NOTE: Don't forget to compile with -lPW.

D A Dixon     ihuxa!dixon      BTL - IH