diff options
-rw-r--r-- | sal/osl/unx/process.c | 30 | ||||
-rwxr-xr-x | sal/util/sal.map | 1 |
2 files changed, 29 insertions, 2 deletions
diff --git a/sal/osl/unx/process.c b/sal/osl/unx/process.c index be2e058eeb78..f73d40db5d86 100644 --- a/sal/osl/unx/process.c +++ b/sal/osl/unx/process.c @@ -2,9 +2,9 @@ * * $RCSfile: process.c,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: obr $ $Date: 2001-05-11 19:20:10 $ + * last change: $Author: obr $ $Date: 2001-05-14 11:01:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2054,3 +2054,29 @@ sal_Bool osl_getFullPath(const sal_Char* pszFilename, sal_Char* pszPath, sal_uIn } +/****************************************************************************** + * + * new function to return the process working dir + * + *****************************************************************************/ + +oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir ) +{ + char buffer[PATH_MAX]; + + if( getcwd( buffer, PATH_MAX ) ) + { + rtl_uString* ustrTmp = NULL; + + /* convert file path to unicode */ + rtl_string2UString( &ustrTmp, buffer, strlen( buffer ), osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS ); + + /* convert file path to file URL */ + osl_getFileURLFromSystemPath( ustrTmp, pustrWorkingDir ); + + rtl_uString_release( ustrTmp ); + return osl_Process_E_None; + } + + return osl_Process_E_Unknown; +} diff --git a/sal/util/sal.map b/sal/util/sal.map index d21bb5d0228a..9a5afc04ff26 100755 --- a/sal/util/sal.map +++ b/sal/util/sal.map @@ -76,6 +76,7 @@ UDK_2_0_0 { osl_getPeerAddrOfSocket; osl_getProcess; osl_getProcessInfo; + osl_getProcessWorkingDir; osl_getProfileName; osl_getProfileSectionEntries; osl_getProfileSections; |