vbox的更動 16024 路徑 trunk/src/VBox/Runtime/r3/freebsd
- 時間撮記:
- 2009-1-19 上午04:45:55 (16 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp
r11838 r16024 35 35 #include <unistd.h> 36 36 #include <errno.h> 37 #include <dlfcn.h> 38 #include <link.h> 37 39 38 40 #include <iprt/string.h> … … 68 70 69 71 int err = errno; 72 73 /* 74 * Fall back on the dynamic linker since /proc is optional. 75 */ 76 void *hExe = dlopen(NULL, 0); 77 if (hExe) 78 { 79 struct link_map const *pLinkMap = 0; 80 if (dlinfo(hExe, RTLD_DI_LINKMAP, &pLinkMap) == 0) 81 { 82 const char *pszImageName = pLinkMap->l_name; 83 if (*pszImageName == '/') /* this may not always be absolute, despite the docs. :-( */ 84 { 85 char *pszTmp = NULL; 86 int rc = rtPathFromNative(&pszTmp, pszImageName); 87 AssertMsgRCReturn(rc, ("rc=%Rrc pszImageName=\"%s\"\n", rc, pszImageName), rc); 88 89 size_t cch = strlen(pszTmp); 90 AssertReturn(cch <= cchPath, VERR_BUFFER_OVERFLOW); 91 92 memcpy(pszPath, pszTmp, cch + 1); 93 RTStrFree(pszTmp); 94 95 return VINF_SUCCESS; 96 } 97 /** @todo Try search the PATH for the file name or append the current 98 * directory, which ever makes sense... */ 99 } 100 } 101 70 102 int rc = RTErrConvertFromErrno(err); 71 AssertMsgFailed(("rc=%Rrc err=%d cchLink=%d \n", rc, err, cchLink));103 AssertMsgFailed(("rc=%Rrc err=%d cchLink=%d hExe=%p\n", rc, err, cchLink, hExe)); 72 104 return rc; 73 105 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器