Get rid of VG_(getcwd) and replace it with a pair of functions,
VG_(record_startup_wd) which records the working directory at startup,
and VG_(get_startup_wd) which later tells you what value was recorded.
This works because all uses of VG_(getcwd) serve only to record the
directory at process start anyway.  The motivation is that AIX does
not support sys_getcwd directly, so it's easier for the launcher to
ship in the required value using an environment variable.  On Linux
sys_getcwd is used as before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6764 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 7901a01..345a6cb 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -1754,7 +1754,7 @@
    }
 
    /* Get working directory */
-   tl_assert( VG_(getcwd)(base_dir, VKI_PATH_MAX) );
+   tl_assert( VG_(get_startup_wd)(base_dir, VKI_PATH_MAX) );
 
    /* Do we have a --log-file-qualifier= to consider? */
    if (VG_(clo_log_file_qualifier)) {