Changeset 4555 in vbox for trunk/src/VBox
- Timestamp:
- Sep 6, 2007 12:24:20 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/VBox/log-vbox.cpp
r4071 r4555 122 122 # if defined(RT_OS_WINDOWS) 123 123 # include <Windows.h> 124 # elif defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) 124 # elif defined(RT_OS_LINUX) 125 # include <unistd.h> 126 # elif defined(RT_OS_SOLARIS) 127 # define _STRUCTURED_PROC 1 128 # include <sys/procfs.h> 125 129 # include <unistd.h> 126 130 # elif defined(RT_OS_L4) … … 296 300 RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %ls\n", GetCommandLineW()); 297 301 298 # elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS) 302 # elif defined(RT_OS_SOLARIS) 303 psinfo_t psi; 304 char szArgFileBuf[80]; 305 RTStrPrintf(szArgFileBuf, sizeof(szArgFileBuf), "/proc/%ld/psinfo", (long)getpid()); 306 FILE* pFile = fopen(szArgFileBuf, "rb"); 307 if (pFile) 308 { 309 if (fread(&psi, sizeof(psi), 1, pFile) == 1) 310 { 311 # if 0 /* 100% safe:*/ 312 RTLogLoggerEx(pLogger, 0, ~0U, "Args: %s\n", psi.pr_psargs); 313 # else /* probably safe: */ 314 const char * const *argv = (const char * const *)psi.pr_argv; 315 for (int iArg = 0; iArg < psi.pr_argc; iArg++) 316 RTLogLoggerEx(pLogger, 0, ~0U, "Arg[%d]: %s\n", iArg, argv[iArg]); 317 # endif 318 319 } 320 fclose(pFile); 321 } 322 323 # elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 299 324 # ifdef RT_OS_LINUX 300 325 FILE *pFile = fopen("/proc/self/cmdline", "r"); 301 # elif defined(RT_OS_SOLARIS)302 /*303 * I have a sinking feeling solaris' psinfo format could be different from cmdline304 * Must check at run time and possible just ignore this section for solaris305 */306 char szArgFileBuf[80];307 RTStrPrintf(szArgFileBuf, sizeof(szArgFileBuf), "/proc/%ld/psinfo", (long)getpid());308 FILE* pFile = fopen(szArgFileBuf, "r");309 326 # else /* RT_OS_FREEBSD: */ 310 327 FILE *pFile = fopen("/proc/curproc/cmdline", "r");
Note:
See TracChangeset
for help on using the changeset viewer.