Index: /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp	(revision 37630)
+++ /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp	(revision 37631)
@@ -1,9 +1,9 @@
 /* $Id$ */
 /** @file
- * IPRT Testcase - Core Dumper.
+ * IPRT - Custom Core Dumper, Solaris.
  */
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -25,19 +25,20 @@
  */
 
+
 /*******************************************************************************
 *   Header Files                                                               *
 *******************************************************************************/
-#define LOG_GROUP LOG_GROUP_CORE_DUMPER
-#include <VBox/log.h>
+#define LOG_GROUP RTLOGGROUP_DEFAULT
 #include <iprt/coredumper.h>
-#include <iprt/types.h>
-#include <iprt/file.h>
+
+#include <iprt/asm.h>
+#include <iprt/dir.h>
 #include <iprt/err.h>
-#include <iprt/dir.h>
+#include <iprt/log.h>
+#include <iprt/param.h>
 #include <iprt/path.h>
+#include <iprt/process.h>
 #include <iprt/string.h>
 #include <iprt/thread.h>
-#include <iprt/param.h>
-#include <iprt/asm.h>
 #include "coredumper-solaris.h"
 
@@ -62,4 +63,5 @@
 #include "internal/ldrELF64.h"
 
+
 /*******************************************************************************
 *   Globals                                                                    *
@@ -127,5 +129,5 @@
  * Reads from a file making sure an interruption doesn't cause a failure.
  *
- * @param hFile             Handle to the file to read.
+ * @param fd                Handle to the file to read.
  * @param pv                Where to store the read data.
  * @param cbToRead          Size of data to read.
@@ -133,15 +135,24 @@
  * @return IPRT status code.
  */
-static int ReadFileNoIntr(RTFILE hFile, void *pv, size_t cbToRead)
-{
-    int rc = VERR_READ_ERROR;
-    while (1)
-    {
-        rc = RTFileRead(hFile, pv, cbToRead, NULL /* Read all */);
-        if (rc == VERR_INTERRUPTED)
-            continue;
-        break;
-    }
-    return rc;
+static int ReadFileNoIntr(int fd, void *pv, size_t cbToRead)
+{
+    for (;;)
+    {
+        ssize_t cbRead = read(fd, pv, cbToRead);
+        if (cbRead < 0)
+        {
+            if (errno == EINTR)
+                continue;
+            return RTErrConvertFromErrno(errno);
+        }
+        if ((size_t)cbRead == cbToRead)
+            return VINF_SUCCESS;
+        if ((size_t)cbRead > cbToRead)
+            return VERR_INTERNAL_ERROR_3;
+        if (cbRead == 0)
+            return VERR_EOF;
+        pv = (uint8_t *)pv + cbRead;
+        cbToRead -= cbRead;
+    }
 }
 
@@ -150,21 +161,28 @@
  * Writes to a file making sure an interruption doesn't cause a failure.
  *
- * @param hFile             Handle to the file to write.
+ * @param fd                Handle to the file to write to.
  * @param pv                Pointer to what to write.
- * @param cbToRead          Size of data to write.
+ * @param cbToWrite          Size of data to write.
  *
  * @return IPRT status code.
  */
-static int WriteFileNoIntr(RTFILE hFile, const void *pcv, size_t cbToRead)
-{
-    int rc = VERR_READ_ERROR;
-    while (1)
-    {
-        rc = RTFileWrite(hFile, pcv, cbToRead, NULL /* Write all */);
-        if (rc == VERR_INTERRUPTED)
-            continue;
-        break;
-    }
-    return rc;
+static int WriteFileNoIntr(int fd, const void *pv, size_t cbToWrite)
+{
+    for (;;)
+    {
+        ssize_t cbWritten = write(fd, pv, cbToWrite);
+        if (cbWritten < 0)
+        {
+            if (errno == EINTR)
+                continue;
+            return RTErrConvertFromErrno(errno);
+        }
+        if ((size_t)cbWritten == cbToWrite)
+            return VINF_SUCCESS;
+        if ((size_t)cbWritten > cbToWrite)
+            return VERR_INTERNAL_ERROR_2;
+        pv = (uint8_t const *)pv + cbWritten;
+        cbToWrite -= cbWritten;
+    }
 }
 
@@ -173,5 +191,5 @@
  * Read from a given offset in the process' address space.
  *
- * @param pVBoxProc         Pointer to the VBox process.
+ * @param pSolProc         Pointer to the solaris process.
  * @param pv                Where to read the data into.
  * @param cb                Size of the read buffer.
@@ -180,12 +198,25 @@
  * @return VINF_SUCCESS, if all the given bytes was read in, otherwise VERR_READ_ERROR.
  */
-static ssize_t ProcReadAddrSpace(PVBOXPROCESS pVBoxProc, RTFOFF off, void *pvBuf, size_t cbToRead)
-{
-    while (1)
-    {
-        int rc = RTFileReadAt(pVBoxProc->hAs, off, pvBuf, cbToRead, NULL);
-        if (rc == VERR_INTERRUPTED)
-            continue;
-        return rc;
+static ssize_t ProcReadAddrSpace(PRTSOLCOREPROCESS pSolProc, RTFOFF off, void *pvBuf, size_t cbToRead)
+{
+    for (;;)
+    {
+        ssize_t cbRead = pread(pSolProc->fdAs, pvBuf, cbToRead, off);
+        if (cbRead < 0)
+        {
+            if (errno == EINTR)
+                continue;
+            return RTErrConvertFromErrno(errno);
+        }
+        if ((size_t)cbRead == cbToRead)
+            return VINF_SUCCESS;
+        if ((size_t)cbRead > cbToRead)
+            return VERR_INTERNAL_ERROR_4;
+        if (cbRead == 0)
+            return VERR_EOF;
+
+        pvBuf     = (uint8_t *)pvBuf + cbRead;
+        cbToRead -= cbRead;
+        off      += cbRead;
     }
 }
@@ -195,34 +226,50 @@
  * Determines if the current process' architecture is suitable for dumping core.
  *
- * @param pVBoxProc         Pointer to the VBox process.
+ * @param pSolProc         Pointer to the solaris process.
  *
  * @return true if the architecture matches the current one.
  */
-static inline bool IsProcessArchNative(PVBOXPROCESS pVBoxProc)
-{
-    return pVBoxProc->ProcInfo.pr_dmodel == PR_MODEL_NATIVE;
-}
-
-
-/**
- * Helper function to get the size of a file given it's path.
- *
- * @param pszPath           Pointer to the full path of the file.
- *
- * @return The size of the file in bytes.
- */
-static size_t GetFileSize(const char *pszPath)
-{
-    uint64_t cb = 0;
+static inline bool IsProcessArchNative(PRTSOLCOREPROCESS pSolProc)
+{
+    return pSolProc->ProcInfo.pr_dmodel == PR_MODEL_NATIVE;
+}
+
+
+/**
+ * Helper function to get the size_t compatible file size from a file
+ * descriptor.
+ *
+ * @return  The file size (in bytes).
+ * @param   fd              The file descriptor.
+ */
+static size_t GetFileSizeByFd(int fd)
+{
+    struct stat st;
+    if (fstat(fd, &st) == 0)
+        return st.st_size < ~(size_t)0 ? (size_t)st.st_size : ~(size_t)0;
+
+    CORELOGRELSYS((CORELOG_NAME "GetFileSizeByFd: fstat failed rc=%Rrc\n", RTErrConvertFromErrno(errno)));
+    return 0;
+}
+
+
+/**
+ * Helper function to get the size_t compatible size of a file given its path.
+ *
+ * @return  The file size (in bytes).
+ * @param   pszPath         Pointer to the full path of the file.
+ */
+static size_t GetFileSizeByName(const char *pszPath)
+{
     int fd = open(pszPath, O_RDONLY);
-    if (fd >= 0)
-    {
-        RTFILE hFile = (RTFILE)(uintptr_t)fd;
-        RTFileGetSize(hFile, &cb);
-        RTFileClose(hFile);
-    }
-    else
-        CORELOGRELSYS((CORELOG_NAME "GetFileSize: failed to open %s rc=%Rrc\n", pszPath, RTErrConvertFromErrno(fd)));
-    return cb < ~(size_t)0 ? (size_t)cb : ~(size_t)0;
+    if (fd < 0)
+    {
+        CORELOGRELSYS((CORELOG_NAME "GetFileSizeByName: failed to open %s rc=%Rrc\n", pszPath, RTErrConvertFromErrno(errno)));
+        return 0;
+    }
+
+    size_t cb = GetFileSizeByFd(fd);
+    close(fd);
+    return cb;
 }
 
@@ -233,13 +280,13 @@
  * mapped memory area which will be used during the core dumping routines.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int AllocMemoryArea(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore->pvCore == NULL, VERR_ALREADY_EXISTS);
-
-    struct VBOXSOLPREALLOCTABLE
+static int AllocMemoryArea(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore->pvCore == NULL, VERR_ALREADY_EXISTS);
+
+    static struct
     {
         const char *pszFilePath;        /* Proc based path */
@@ -247,8 +294,9 @@
         size_t      cbEntry;            /* Size of each entry in file */
         size_t      cbAccounting;       /* Size of each accounting entry per entry */
-    } aPreAllocTable[] = {
-        { "/proc/%d/map",        0,                  sizeof(prmap_t),       sizeof(VBOXSOLMAPINFO) },
+    } const s_aPreAllocTable[] =
+    {
+        { "/proc/%d/map",        0,                  sizeof(prmap_t),       sizeof(RTSOLCOREMAPINFO) },
         { "/proc/%d/auxv",       0,                  0,                     0 },
-        { "/proc/%d/lpsinfo",    sizeof(prheader_t), sizeof(lwpsinfo_t),    sizeof(VBOXSOLTHREADINFO) },
+        { "/proc/%d/lpsinfo",    sizeof(prheader_t), sizeof(lwpsinfo_t),    sizeof(RTSOLCORETHREADINFO) },
         { "/proc/%d/lstatus",    0,                  0,                     0 },
         { "/proc/%d/ldt",        0,                  0,                     0 },
@@ -258,16 +306,16 @@
 
     size_t cb = 0;
-    for (int i = 0; i < (int)RT_ELEMENTS(aPreAllocTable); i++)
+    for (unsigned i = 0; i < RT_ELEMENTS(s_aPreAllocTable); i++)
     {
         char szPath[PATH_MAX];
-        RTStrPrintf(szPath, sizeof(szPath), aPreAllocTable[i].pszFilePath, (int)pVBoxCore->VBoxProc.Process);
-        size_t cbFile = GetFileSize(szPath);
+        RTStrPrintf(szPath, sizeof(szPath), s_aPreAllocTable[i].pszFilePath, (int)pSolCore->SolProc.Process);
+        size_t cbFile = GetFileSizeByName(szPath);
         cb += cbFile;
         if (   cbFile > 0
-            && aPreAllocTable[i].cbEntry > 0)
-        {
-            cb += ((cbFile - aPreAllocTable[i].cbHeader) / aPreAllocTable[i].cbEntry) * (aPreAllocTable[i].cbAccounting > 0 ?
-                                                                                         aPreAllocTable[i].cbAccounting : 1);
-            cb += aPreAllocTable[i].cbHeader;
+            && s_aPreAllocTable[i].cbEntry > 0)
+        {
+            cb += ((cbFile - s_aPreAllocTable[i].cbHeader) / s_aPreAllocTable[i].cbEntry)
+                * (s_aPreAllocTable[i].cbAccounting > 0 ? s_aPreAllocTable[i].cbAccounting : 1);
+            cb += s_aPreAllocTable[i].cbHeader;
         }
     }
@@ -276,5 +324,5 @@
      * Make room for our own mapping accountant entry which will also be included in the core.
      */
-    cb += sizeof(VBOXSOLMAPINFO);
+    cb += sizeof(RTSOLCOREMAPINFO);
 
     /*
@@ -286,14 +334,11 @@
     {
         CORELOG((CORELOG_NAME "AllocMemoryArea: memory area of %u bytes allocated.\n", cb));
-        pVBoxCore->pvCore = pv;
-        pVBoxCore->pvFree = pv;
-        pVBoxCore->cbCore = cb;
+        pSolCore->pvCore = pv;
+        pSolCore->pvFree = pv;
+        pSolCore->cbCore = cb;
         return VINF_SUCCESS;
     }
-    else
-    {
-        CORELOGRELSYS((CORELOG_NAME "AllocMemoryArea: failed cb=%u\n", cb));
-        return VERR_NO_MEMORY;
-    }
+    CORELOGRELSYS((CORELOG_NAME "AllocMemoryArea: failed cb=%u\n", cb));
+    return VERR_NO_MEMORY;
 }
 
@@ -302,18 +347,18 @@
  * Free memory area used by the core object.
  *
- * @param pVBoxCore         Pointer to the core object.
- */
-static void FreeMemoryArea(PVBOXCORE pVBoxCore)
-{
-    AssertReturnVoid(pVBoxCore);
-    AssertReturnVoid(pVBoxCore->pvCore);
-    AssertReturnVoid(pVBoxCore->cbCore > 0);
-
-    munmap(pVBoxCore->pvCore, pVBoxCore->cbCore);
-    CORELOG((CORELOG_NAME "FreeMemoryArea: memory area of %u bytes freed.\n", pVBoxCore->cbCore));
-
-    pVBoxCore->pvCore = NULL;
-    pVBoxCore->pvFree= NULL;
-    pVBoxCore->cbCore = 0;
+ * @param pSolCore          Pointer to the core object.
+ */
+static void FreeMemoryArea(PRTSOLCORE pSolCore)
+{
+    AssertReturnVoid(pSolCore);
+    AssertReturnVoid(pSolCore->pvCore);
+    AssertReturnVoid(pSolCore->cbCore > 0);
+
+    munmap(pSolCore->pvCore, pSolCore->cbCore);
+    CORELOG((CORELOG_NAME "FreeMemoryArea: memory area of %u bytes freed.\n", pSolCore->cbCore));
+
+    pSolCore->pvCore = NULL;
+    pSolCore->pvFree= NULL;
+    pSolCore->cbCore = 0;
 }
 
@@ -322,20 +367,20 @@
  * Get a chunk from the area of allocated memory.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param cb                Size of requested chunk.
  *
  * @return Pointer to allocated memory, or NULL on failure.
  */
-static void *GetMemoryChunk(PVBOXCORE pVBoxCore, size_t cb)
-{
-    AssertReturn(pVBoxCore, NULL);
-    AssertReturn(pVBoxCore->pvCore, NULL);
-    AssertReturn(pVBoxCore->pvFree, NULL);
-
-    size_t cbAllocated = (char *)pVBoxCore->pvFree - (char *)pVBoxCore->pvCore;
-    if (cbAllocated < pVBoxCore->cbCore)
-    {
-        char *pb = (char *)pVBoxCore->pvFree;
-        pVBoxCore->pvFree = pb + cb;
+static void *GetMemoryChunk(PRTSOLCORE pSolCore, size_t cb)
+{
+    AssertReturn(pSolCore, NULL);
+    AssertReturn(pSolCore->pvCore, NULL);
+    AssertReturn(pSolCore->pvFree, NULL);
+
+    size_t cbAllocated = (char *)pSolCore->pvFree - (char *)pSolCore->pvCore;
+    if (cbAllocated < pSolCore->cbCore)
+    {
+        char *pb = (char *)pSolCore->pvFree;
+        pSolCore->pvFree = pb + cb;
         return pb;
     }
@@ -348,5 +393,5 @@
  * Reads the proc file's content into a newly allocated buffer.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param pszFileFmt        Only the name of the file to read from (/proc/<pid> will be prepended)
  * @param ppv               Where to store the allocated buffer.
@@ -357,23 +402,20 @@
  *          respectively.
  */
-static int ProcReadFileInto(PVBOXCORE pVBoxCore, const char *pszProcFileName, void **ppv, size_t *pcb)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
+static int ProcReadFileInto(PRTSOLCORE pSolCore, const char *pszProcFileName, void **ppv, size_t *pcb)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
 
     char szPath[PATH_MAX];
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/%s", (int)pVBoxCore->VBoxProc.Process, pszProcFileName);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/%s", (int)pSolCore->SolProc.Process, pszProcFileName);
     int rc = VINF_SUCCESS;
     int fd = open(szPath, O_RDONLY);
     if (fd >= 0)
     {
-        RTFILE hFile = (RTFILE)(uintptr_t)fd;
-        uint64_t u64Size;
-        RTFileGetSize(hFile, &u64Size);
-        *pcb = u64Size < ~(size_t)0 ? u64Size : ~(size_t)0;
+        *pcb = GetFileSizeByFd(fd);
         if (*pcb > 0)
         {
-            *ppv = GetMemoryChunk(pVBoxCore, *pcb);
+            *ppv = GetMemoryChunk(pSolCore, *pcb);
             if (*ppv)
-                rc = ReadFileNoIntr(hFile, *ppv, *pcb);
+                rc = ReadFileNoIntr(fd, *ppv, *pcb);
             else
                 rc = VERR_NO_MEMORY;
@@ -385,5 +427,5 @@
             rc = VINF_SUCCESS;
         }
-        RTFileClose(hFile);
+        close(fd);
     }
     else
@@ -399,24 +441,23 @@
  * Read process information (format psinfo_t) from /proc.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int ProcReadInfo(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ProcReadInfo(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     char szPath[PATH_MAX];
     int rc = VINF_SUCCESS;
 
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/psinfo", (int)pVBoxProc->Process);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/psinfo", (int)pSolProc->Process);
     int fd = open(szPath, O_RDONLY);
     if (fd >= 0)
     {
-        RTFILE hFile = (RTFILE)(uintptr_t)fd;
         size_t cbProcInfo = sizeof(psinfo_t);
-        rc = ReadFileNoIntr(hFile, &pVBoxProc->ProcInfo, cbProcInfo);
-        RTFileClose(hFile);
+        rc = ReadFileNoIntr(fd, &pSolProc->ProcInfo, cbProcInfo);
+        close(fd);
     }
     else
@@ -433,27 +474,25 @@
  * Read process status (format pstatus_t) from /proc.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int ProcReadStatus(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ProcReadStatus(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
     char szPath[PATH_MAX];
     int rc = VINF_SUCCESS;
 
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/status", (int)pVBoxProc->Process);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/status", (int)pSolProc->Process);
     int fd = open(szPath, O_RDONLY);
     if (fd >= 0)
     {
-        RTFILE hFile = (RTFILE)(uintptr_t)fd;
-        size_t cbRead;
         size_t cbProcStatus = sizeof(pstatus_t);
-        AssertCompile(sizeof(pstatus_t) == sizeof(pVBoxProc->ProcStatus));
-        rc = ReadFileNoIntr(hFile, &pVBoxProc->ProcStatus, cbProcStatus);
-        RTFileClose(hFile);
+        AssertCompile(sizeof(pstatus_t) == sizeof(pSolProc->ProcStatus));
+        rc = ReadFileNoIntr(fd, &pSolProc->ProcStatus, cbProcStatus);
+        close(fd);
     }
     else
@@ -469,15 +508,15 @@
  * Read process credential information (format prcred_t + array of guid_t)
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadCred(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    return ProcReadFileInto(pVBoxCore, "cred", &pVBoxProc->pvCred, &pVBoxProc->cbCred);
+static int ProcReadCred(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    return ProcReadFileInto(pSolCore, "cred", &pSolProc->pvCred, &pSolProc->cbCred);
 }
 
@@ -486,19 +525,19 @@
  * Read process privilege information (format prpriv_t + array of priv_chunk_t)
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadPriv(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    int rc = ProcReadFileInto(pVBoxCore, "priv", (void **)&pVBoxProc->pPriv, &pVBoxProc->cbPriv);
+static int ProcReadPriv(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    int rc = ProcReadFileInto(pSolCore, "priv", (void **)&pSolProc->pPriv, &pSolProc->cbPriv);
     if (RT_FAILURE(rc))
         return rc;
-    pVBoxProc->pcPrivImpl = getprivimplinfo();
-    if (!pVBoxProc->pcPrivImpl)
+    pSolProc->pcPrivImpl = getprivimplinfo();
+    if (!pSolProc->pcPrivImpl)
     {
         CORELOGRELSYS((CORELOG_NAME "ProcReadPriv: getprivimplinfo returned NULL.\n"));
@@ -512,15 +551,15 @@
  * Read process LDT information (format array of struct ssd) from /proc.
  *
- * @param pVBoxProc         Pointer to the core object.
+ * @param pSolProc         Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadLdt(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    return ProcReadFileInto(pVBoxCore, "ldt", &pVBoxProc->pvLdt, &pVBoxProc->cbLdt);
+static int ProcReadLdt(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    return ProcReadFileInto(pSolCore, "ldt", &pSolProc->pvLdt, &pSolProc->cbLdt);
 }
 
@@ -529,17 +568,17 @@
  * Read process auxiliary vectors (format auxv_t) for the process.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadAuxVecs(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ProcReadAuxVecs(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     char szPath[PATH_MAX];
     int rc = VINF_SUCCESS;
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/auxv", (int)pVBoxProc->Process);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/auxv", (int)pSolProc->Process);
     int fd = open(szPath, O_RDONLY);
     if (fd < 0)
@@ -550,38 +589,33 @@
     }
 
-    RTFILE hFile = (RTFILE)(uintptr_t)fd;
-    uint64_t u64Size;
-    RTFileGetSize(hFile, &u64Size);
-    size_t cbAuxFile = u64Size < ~(size_t)0 ? u64Size : ~(size_t)0;
+    size_t cbAuxFile = GetFileSizeByFd(fd);
     if (cbAuxFile >= sizeof(auxv_t))
     {
-        pVBoxProc->pAuxVecs = (auxv_t*)GetMemoryChunk(pVBoxCore, cbAuxFile + sizeof(auxv_t));
-        if (pVBoxProc->pAuxVecs)
-        {
-            rc = ReadFileNoIntr(hFile, pVBoxProc->pAuxVecs, cbAuxFile);
+        pSolProc->pAuxVecs = (auxv_t*)GetMemoryChunk(pSolCore, cbAuxFile + sizeof(auxv_t));
+        if (pSolProc->pAuxVecs)
+        {
+            rc = ReadFileNoIntr(fd, pSolProc->pAuxVecs, cbAuxFile);
             if (RT_SUCCESS(rc))
             {
                 /* Terminate list of vectors */
-                pVBoxProc->cAuxVecs = cbAuxFile / sizeof(auxv_t);
+                pSolProc->cAuxVecs = cbAuxFile / sizeof(auxv_t);
                 CORELOG((CORELOG_NAME "ProcReadAuxVecs: cbAuxFile=%u auxv_t size %d cAuxVecs=%u\n", cbAuxFile, sizeof(auxv_t),
-                         pVBoxProc->cAuxVecs));
-                if (pVBoxProc->cAuxVecs > 0)
+                         pSolProc->cAuxVecs));
+                if (pSolProc->cAuxVecs > 0)
                 {
-                    pVBoxProc->pAuxVecs[pVBoxProc->cAuxVecs].a_type = AT_NULL;
-                    pVBoxProc->pAuxVecs[pVBoxProc->cAuxVecs].a_un.a_val = 0L;
-                    RTFileClose(hFile);
+                    pSolProc->pAuxVecs[pSolProc->cAuxVecs].a_type = AT_NULL;
+                    pSolProc->pAuxVecs[pSolProc->cAuxVecs].a_un.a_val = 0L;
+                    close(fd);
                     return VINF_SUCCESS;
                 }
-                else
-                {
-                    CORELOGRELSYS((CORELOG_NAME "ProcReadAuxVecs: Invalid vector count %u\n", pVBoxProc->cAuxVecs));
-                    rc = VERR_READ_ERROR;
-                }
+
+                CORELOGRELSYS((CORELOG_NAME "ProcReadAuxVecs: Invalid vector count %u\n", pSolProc->cAuxVecs));
+                rc = VERR_READ_ERROR;
             }
             else
                 CORELOGRELSYS((CORELOG_NAME "ProcReadAuxVecs: ReadFileNoIntr failed. rc=%Rrc cbAuxFile=%u\n", rc, cbAuxFile));
 
-            pVBoxProc->pAuxVecs = NULL;
-            pVBoxProc->cAuxVecs = 0;
+            pSolProc->pAuxVecs = NULL;
+            pSolProc->cAuxVecs = 0;
         }
         else
@@ -597,5 +631,5 @@
     }
 
-    RTFileClose(hFile);
+    close(fd);
     return rc;
 }
@@ -605,10 +639,10 @@
  * Find an element in the process' auxiliary vector.
  */
-static long GetAuxVal(PVBOXPROCESS pVBoxProc, int Type)
-{
-    AssertReturn(pVBoxProc, -1);
-    if (pVBoxProc->pAuxVecs)
-    {
-        auxv_t *pAuxVec = pVBoxProc->pAuxVecs;
+static long GetAuxVal(PRTSOLCOREPROCESS pSolProc, int Type)
+{
+    AssertReturn(pSolProc, -1);
+    if (pSolProc->pAuxVecs)
+    {
+        auxv_t *pAuxVec = pSolProc->pAuxVecs;
         for (; pAuxVec->a_type != AT_NULL; pAuxVec++)
         {
@@ -624,62 +658,57 @@
  * Read the process mappings (format prmap_t array).
  *
- * @param   pVBoxCore           Pointer to the core object.
+ * @param   pSolCore            Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadMappings(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ProcReadMappings(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     char szPath[PATH_MAX];
     int rc = VINF_SUCCESS;
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/map", (int)pVBoxProc->Process);
-    int fd = open(szPath, O_RDONLY);
-    if (fd < 0)
-    {
-        rc = RTErrConvertFromErrno(fd);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/map", (int)pSolProc->Process);
+    int fdMap = open(szPath, O_RDONLY);
+    if (fdMap < 0)
+    {
+        rc = RTErrConvertFromErrno(errno);
         CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: failed to open %s. rc=%Rrc\n", szPath, rc));
         return rc;
     }
 
-    RTFILE hFile = (RTFILE)(uintptr_t)fd;
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/as", (int)pVBoxProc->Process);
-    fd = open(szPath, O_RDONLY);
-    if (fd >= 0)
-    {
-        pVBoxProc->hAs = (RTFILE)(uintptr_t)fd;
-
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/as", (int)pSolProc->Process);
+    pSolProc->fdAs = open(szPath, O_RDONLY);
+    if (pSolProc->fdAs >= 0)
+    {
         /*
          * Allocate and read all the prmap_t objects from proc.
          */
-        uint64_t u64Size;
-        RTFileGetSize(hFile, &u64Size);
-        size_t cbMapFile = u64Size < ~(size_t)0 ? u64Size : ~(size_t)0;
+        size_t cbMapFile = GetFileSizeByFd(fdMap);
         if (cbMapFile >= sizeof(prmap_t))
         {
-            prmap_t *pMap = (prmap_t*)GetMemoryChunk(pVBoxCore, cbMapFile);
+            prmap_t *pMap = (prmap_t*)GetMemoryChunk(pSolCore, cbMapFile);
             if (pMap)
             {
-                rc = ReadFileNoIntr(hFile, pMap, cbMapFile);
+                rc = ReadFileNoIntr(fdMap, pMap, cbMapFile);
                 if (RT_SUCCESS(rc))
                 {
-                    pVBoxProc->cMappings = cbMapFile / sizeof(prmap_t);
-                    if (pVBoxProc->cMappings > 0)
+                    pSolProc->cMappings = cbMapFile / sizeof(prmap_t);
+                    if (pSolProc->cMappings > 0)
                     {
                         /*
-                         * Allocate for each prmap_t object, a corresponding VBOXSOLMAPINFO object.
+                         * Allocate for each prmap_t object, a corresponding RTSOLCOREMAPINFO object.
                          */
-                        pVBoxProc->pMapInfoHead = (PVBOXSOLMAPINFO)GetMemoryChunk(pVBoxCore, pVBoxProc->cMappings * sizeof(VBOXSOLMAPINFO));
-                        if (pVBoxProc->pMapInfoHead)
+                        pSolProc->pMapInfoHead = (PRTSOLCOREMAPINFO)GetMemoryChunk(pSolCore, pSolProc->cMappings * sizeof(RTSOLCOREMAPINFO));
+                        if (pSolProc->pMapInfoHead)
                         {
                             /*
                              * Associate the prmap_t with the mapping info object.
                              */
-                            Assert(pVBoxProc->pMapInfoHead == NULL);
-                            PVBOXSOLMAPINFO pCur = pVBoxProc->pMapInfoHead;
-                            PVBOXSOLMAPINFO pPrev = NULL;
-                            for (uint64_t i = 0; i < pVBoxProc->cMappings; i++, pMap++, pCur++)
+                            /*Assert(pSolProc->pMapInfoHead == NULL); - does not make sense */
+                            PRTSOLCOREMAPINFO pCur = pSolProc->pMapInfoHead;
+                            PRTSOLCOREMAPINFO pPrev = NULL;
+                            for (uint64_t i = 0; i < pSolProc->cMappings; i++, pMap++, pCur++)
                             {
                                 memcpy(&pCur->pMap, pMap, sizeof(pCur->pMap));
@@ -697,5 +726,5 @@
                                 {
                                     size_t cb = RT_MIN(sizeof(achBuf), pCur->pMap.pr_size - k);
-                                    int rc2 = ProcReadAddrSpace(pVBoxProc, pCur->pMap.pr_vaddr + k, &achBuf, cb);
+                                    int rc2 = ProcReadAddrSpace(pSolProc, pCur->pMap.pr_vaddr + k, &achBuf, cb);
                                     if (RT_FAILURE(rc2))
                                     {
@@ -722,20 +751,18 @@
                                 pPrev->pNext = NULL;
 
-                            RTFileClose(hFile);
-                            RTFileClose(pVBoxProc->hAs);
-                            pVBoxProc->hAs = NIL_RTFILE;
-                            CORELOG((CORELOG_NAME "ProcReadMappings: successfully read in %u mappings\n", pVBoxProc->cMappings));
+                            close(fdMap);
+                            close(pSolProc->fdAs);
+                            pSolProc->fdAs = -1;
+                            CORELOG((CORELOG_NAME "ProcReadMappings: successfully read in %u mappings\n", pSolProc->cMappings));
                             return VINF_SUCCESS;
                         }
-                        else
-                        {
-                            CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: GetMemoryChunk failed %u\n",
-                                           pVBoxProc->cMappings * sizeof(VBOXSOLMAPINFO)));
-                            rc = VERR_NO_MEMORY;
-                        }
+
+                        CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: GetMemoryChunk failed %u\n",
+                                       pSolProc->cMappings * sizeof(RTSOLCOREMAPINFO)));
+                        rc = VERR_NO_MEMORY;
                     }
                     else
                     {
-                        CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: Invalid mapping count %u\n", pVBoxProc->cMappings));
+                        CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: Invalid mapping count %u\n", pSolProc->cMappings));
                         rc = VERR_READ_ERROR;
                     }
@@ -751,11 +778,11 @@
         }
 
-        RTFileClose(pVBoxProc->hAs);
-        pVBoxProc->hAs = NIL_RTFILE;
+        close(pSolProc->fdAs);
+        pSolProc->fdAs = -1;
     }
     else
         CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: failed to open %s. rc=%Rrc\n", szPath, rc));
 
-    RTFileClose(hFile);
+    close(fdMap);
     return rc;
 }
@@ -765,15 +792,15 @@
  * Reads the thread information for all threads in the process.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @remarks Should not be called before successful call to @see AllocMemoryArea()
  * @return IPRT status code.
  */
-static int ProcReadThreads(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    AssertReturn(pVBoxProc->pCurThreadCtx, VERR_NO_DATA);
+static int ProcReadThreads(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    AssertReturn(pSolProc->pCurThreadCtx, VERR_NO_DATA);
 
     /*
@@ -783,5 +810,5 @@
     size_t cbInfoHdrAndData;
     void *pvInfoHdr = NULL;
-    int rc = ProcReadFileInto(pVBoxCore, "lpsinfo", &pvInfoHdr, &cbInfoHdrAndData);
+    int rc = ProcReadFileInto(pSolCore, "lpsinfo", &pvInfoHdr, &cbInfoHdrAndData);
     if (RT_SUCCESS(rc))
     {
@@ -792,5 +819,5 @@
         void *pvStatusHdr = NULL;
         size_t cbStatusHdrAndData;
-        rc = ProcReadFileInto(pVBoxCore, "lstatus", &pvStatusHdr, &cbStatusHdrAndData);
+        rc = ProcReadFileInto(pSolCore, "lstatus", &pvStatusHdr, &cbStatusHdrAndData);
         if (RT_SUCCESS(rc))
         {
@@ -844,10 +871,10 @@
                     cStatus = pInfoHdr->pr_nent;
 
-                    size_t cbThreadInfo = RT_MAX(cStatus, cInfo) * sizeof(VBOXSOLTHREADINFO);
-                    pVBoxProc->pThreadInfoHead = (PVBOXSOLTHREADINFO)GetMemoryChunk(pVBoxCore, cbThreadInfo);
-                    if (pVBoxProc->pThreadInfoHead)
+                    size_t cbThreadInfo = RT_MAX(cStatus, cInfo) * sizeof(RTSOLCORETHREADINFO);
+                    pSolProc->pThreadInfoHead = (PRTSOLCORETHREADINFO)GetMemoryChunk(pSolCore, cbThreadInfo);
+                    if (pSolProc->pThreadInfoHead)
                     {
-                        PVBOXSOLTHREADINFO pCur = pVBoxProc->pThreadInfoHead;
-                        PVBOXSOLTHREADINFO pPrev = NULL;
+                        PRTSOLCORETHREADINFO pCur = pSolProc->pThreadInfoHead;
+                        PRTSOLCORETHREADINFO pPrev = NULL;
                         for (uint64_t i = 0; i < cInfo; i++, pCur++)
                         {
@@ -861,14 +888,14 @@
                                  */
                                 if (   pStatus          /* noid droid */
-                                    && pStatus->pr_lwpid == (id_t)pVBoxProc->hCurThread)
+                                    && pStatus->pr_lwpid == (id_t)pSolProc->hCurThread)
                                 {
-                                    AssertCompile(sizeof(pStatus->pr_reg) == sizeof(pVBoxProc->pCurThreadCtx->uc_mcontext.gregs));
-                                    AssertCompile(sizeof(pStatus->pr_fpreg) == sizeof(pVBoxProc->pCurThreadCtx->uc_mcontext.fpregs));
-                                    memcpy(&pStatus->pr_reg, &pVBoxProc->pCurThreadCtx->uc_mcontext.gregs, sizeof(pStatus->pr_reg));
-                                    memcpy(&pStatus->pr_fpreg, &pVBoxProc->pCurThreadCtx->uc_mcontext.fpregs, sizeof(pStatus->pr_fpreg));
-
-                                    AssertCompile(sizeof(pStatus->pr_lwphold) == sizeof(pVBoxProc->pCurThreadCtx->uc_sigmask));
-                                    memcpy(&pStatus->pr_lwphold, &pVBoxProc->pCurThreadCtx->uc_sigmask, sizeof(pStatus->pr_lwphold));
-                                    pStatus->pr_ustack = (uintptr_t)&pVBoxProc->pCurThreadCtx->uc_stack;
+                                    AssertCompile(sizeof(pStatus->pr_reg) == sizeof(pSolProc->pCurThreadCtx->uc_mcontext.gregs));
+                                    AssertCompile(sizeof(pStatus->pr_fpreg) == sizeof(pSolProc->pCurThreadCtx->uc_mcontext.fpregs));
+                                    memcpy(&pStatus->pr_reg, &pSolProc->pCurThreadCtx->uc_mcontext.gregs, sizeof(pStatus->pr_reg));
+                                    memcpy(&pStatus->pr_fpreg, &pSolProc->pCurThreadCtx->uc_mcontext.fpregs, sizeof(pStatus->pr_fpreg));
+
+                                    AssertCompile(sizeof(pStatus->pr_lwphold) == sizeof(pSolProc->pCurThreadCtx->uc_sigmask));
+                                    memcpy(&pStatus->pr_lwphold, &pSolProc->pCurThreadCtx->uc_sigmask, sizeof(pStatus->pr_lwphold));
+                                    pStatus->pr_ustack = (uintptr_t)&pSolProc->pCurThreadCtx->uc_stack;
 
                                     CORELOG((CORELOG_NAME "ProcReadThreads: patched dumper thread context with pre-dump time context.\n"));
@@ -893,5 +920,5 @@
 
                         CORELOG((CORELOG_NAME "ProcReadThreads: successfully read %u threads.\n", cInfo));
-                        pVBoxProc->cThreads = cInfo;
+                        pSolProc->cThreads = cInfo;
                         return VINF_SUCCESS;
                     }
@@ -927,13 +954,13 @@
  * This may include platform name, zone name and other OS-specific information.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int ProcReadMiscInfo(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ProcReadMiscInfo(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
 #ifdef RT_OS_SOLARIS
@@ -941,5 +968,5 @@
      * Read the platform name, uname string and zone name.
      */
-    int rc = sysinfo(SI_PLATFORM, pVBoxProc->szPlatform, sizeof(pVBoxProc->szPlatform));
+    int rc = sysinfo(SI_PLATFORM, pSolProc->szPlatform, sizeof(pSolProc->szPlatform));
     if (rc == -1)
     {
@@ -947,7 +974,7 @@
         return VERR_GENERAL_FAILURE;
     }
-    pVBoxProc->szPlatform[sizeof(pVBoxProc->szPlatform) - 1] = '\0';
-
-    rc = uname(&pVBoxProc->UtsName);
+    pSolProc->szPlatform[sizeof(pSolProc->szPlatform) - 1] = '\0';
+
+    rc = uname(&pSolProc->UtsName);
     if (rc == -1)
     {
@@ -956,12 +983,12 @@
     }
 
-    rc = getzonenamebyid(pVBoxProc->ProcInfo.pr_zoneid, pVBoxProc->szZoneName, sizeof(pVBoxProc->szZoneName));
+    rc = getzonenamebyid(pSolProc->ProcInfo.pr_zoneid, pSolProc->szZoneName, sizeof(pSolProc->szZoneName));
     if (rc < 0)
     {
         CORELOGRELSYS((CORELOG_NAME "ProcReadMiscInfo: getzonenamebyid failed. rc=%d errno=%d zoneid=%d\n", rc, errno,
-                       pVBoxProc->ProcInfo.pr_zoneid));
+                       pSolProc->ProcInfo.pr_zoneid));
         return VERR_GENERAL_FAILURE;
     }
-    pVBoxProc->szZoneName[sizeof(pVBoxProc->szZoneName) - 1] = '\0';
+    pSolProc->szZoneName[sizeof(pSolProc->szZoneName) - 1] = '\0';
     rc = VINF_SUCCESS;
 
@@ -977,14 +1004,14 @@
  * info. for backward and GDB compatibility, hence the need for this ugly function.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param pInfo             Pointer to the old prpsinfo_t structure to update.
  */
-static void GetOldProcessInfo(PVBOXCORE pVBoxCore, prpsinfo_t *pInfo)
-{
-    AssertReturnVoid(pVBoxCore);
+static void GetOldProcessInfo(PRTSOLCORE pSolCore, prpsinfo_t *pInfo)
+{
+    AssertReturnVoid(pSolCore);
     AssertReturnVoid(pInfo);
 
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    psinfo_t *pSrc = &pVBoxProc->ProcInfo;
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    psinfo_t *pSrc = &pSolProc->ProcInfo;
     memset(pInfo, 0, sizeof(prpsinfo_t));
     pInfo->pr_state    = pSrc->pr_lwp.pr_state;
@@ -1033,5 +1060,5 @@
  * info. for backward and GDB compatibility, hence the need for this ugly function.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param pInfo             Pointer to the thread info.
  * @param pStatus           Pointer to the thread status.
@@ -1039,12 +1066,12 @@
  *
  */
-static void GetOldProcessStatus(PVBOXCORE pVBoxCore, lwpsinfo_t *pInfo, lwpstatus_t *pStatus, prstatus_t *pDst)
-{
-    AssertReturnVoid(pVBoxCore);
+static void GetOldProcessStatus(PRTSOLCORE pSolCore, lwpsinfo_t *pInfo, lwpstatus_t *pStatus, prstatus_t *pDst)
+{
+    AssertReturnVoid(pSolCore);
     AssertReturnVoid(pInfo);
     AssertReturnVoid(pStatus);
     AssertReturnVoid(pDst);
 
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     memset(pDst, 0, sizeof(prstatus_t));
     if (pStatus->pr_flags & PR_STOPPED)
@@ -1096,18 +1123,18 @@
     RTStrCopy(pDst->pr_clname, sizeof(pDst->pr_clname), pStatus->pr_clname);
 
-    pDst->pr_nlwp       = pVBoxProc->ProcStatus.pr_nlwp;
-    pDst->pr_sigpend    = pVBoxProc->ProcStatus.pr_sigpend;
-    pDst->pr_pid        = pVBoxProc->ProcStatus.pr_pid;
-    pDst->pr_ppid       = pVBoxProc->ProcStatus.pr_ppid;
-    pDst->pr_pgrp       = pVBoxProc->ProcStatus.pr_pgid;
-    pDst->pr_sid        = pVBoxProc->ProcStatus.pr_sid;
-    pDst->pr_utime      = pVBoxProc->ProcStatus.pr_utime;
-    pDst->pr_stime      = pVBoxProc->ProcStatus.pr_stime;
-    pDst->pr_cutime     = pVBoxProc->ProcStatus.pr_cutime;
-    pDst->pr_cstime     = pVBoxProc->ProcStatus.pr_cstime;
-    pDst->pr_brkbase    = (caddr_t)pVBoxProc->ProcStatus.pr_brkbase;
-    pDst->pr_brksize    = pVBoxProc->ProcStatus.pr_brksize;
-    pDst->pr_stkbase    = (caddr_t)pVBoxProc->ProcStatus.pr_stkbase;
-    pDst->pr_stksize    = pVBoxProc->ProcStatus.pr_stksize;
+    pDst->pr_nlwp       = pSolProc->ProcStatus.pr_nlwp;
+    pDst->pr_sigpend    = pSolProc->ProcStatus.pr_sigpend;
+    pDst->pr_pid        = pSolProc->ProcStatus.pr_pid;
+    pDst->pr_ppid       = pSolProc->ProcStatus.pr_ppid;
+    pDst->pr_pgrp       = pSolProc->ProcStatus.pr_pgid;
+    pDst->pr_sid        = pSolProc->ProcStatus.pr_sid;
+    pDst->pr_utime      = pSolProc->ProcStatus.pr_utime;
+    pDst->pr_stime      = pSolProc->ProcStatus.pr_stime;
+    pDst->pr_cutime     = pSolProc->ProcStatus.pr_cutime;
+    pDst->pr_cstime     = pSolProc->ProcStatus.pr_cstime;
+    pDst->pr_brkbase    = (caddr_t)pSolProc->ProcStatus.pr_brkbase;
+    pDst->pr_brksize    = pSolProc->ProcStatus.pr_brksize;
+    pDst->pr_stkbase    = (caddr_t)pSolProc->ProcStatus.pr_stkbase;
+    pDst->pr_stksize    = pSolProc->ProcStatus.pr_stksize;
 
     pDst->pr_processor  = (short)pInfo->pr_onpro;
@@ -1120,17 +1147,17 @@
  * Callback for rtCoreDumperForEachThread to suspend a thread.
  *
- * @param pVBoxCore             Pointer to the core object.
+ * @param pSolCore              Pointer to the core object.
  * @param pvThreadInfo          Opaque pointer to thread information.
  *
  * @return IPRT status code.
  */
-static int suspendThread(PVBOXCORE pVBoxCore, void *pvThreadInfo)
+static int suspendThread(PRTSOLCORE pSolCore, void *pvThreadInfo)
 {
     AssertPtrReturn(pvThreadInfo, VERR_INVALID_POINTER);
-    NOREF(pVBoxCore);
+    NOREF(pSolCore);
 
     lwpsinfo_t *pThreadInfo = (lwpsinfo_t *)pvThreadInfo;
     CORELOG((CORELOG_NAME ":suspendThread %d\n", (lwpid_t)pThreadInfo->pr_lwpid));
-    if ((lwpid_t)pThreadInfo->pr_lwpid != pVBoxCore->VBoxProc.hCurThread)
+    if ((lwpid_t)pThreadInfo->pr_lwpid != pSolCore->SolProc.hCurThread)
         _lwp_suspend(pThreadInfo->pr_lwpid);
     return VINF_SUCCESS;
@@ -1141,17 +1168,17 @@
  * Callback for rtCoreDumperForEachThread to resume a thread.
  *
- * @param pVBoxCore             Pointer to the core object.
+ * @param pSolCore              Pointer to the core object.
  * @param pvThreadInfo          Opaque pointer to thread information.
  *
  * @return IPRT status code.
  */
-static int resumeThread(PVBOXCORE pVBoxCore, void *pvThreadInfo)
+static int resumeThread(PRTSOLCORE pSolCore, void *pvThreadInfo)
 {
     AssertPtrReturn(pvThreadInfo, VERR_INVALID_POINTER);
-    NOREF(pVBoxCore);
+    NOREF(pSolCore);
 
     lwpsinfo_t *pThreadInfo = (lwpsinfo_t *)pvThreadInfo;
     CORELOG((CORELOG_NAME ":resumeThread %d\n", (lwpid_t)pThreadInfo->pr_lwpid));
-    if ((lwpid_t)pThreadInfo->pr_lwpid != (lwpid_t)pVBoxCore->VBoxProc.hCurThread)
+    if ((lwpid_t)pThreadInfo->pr_lwpid != (lwpid_t)pSolCore->SolProc.hCurThread)
         _lwp_continue(pThreadInfo->pr_lwpid);
     return VINF_SUCCESS;
@@ -1162,5 +1189,5 @@
  * Calls a thread worker function for all threads in the process as described by /proc
  *
- * @param pVBoxCore             Pointer to the core object.
+ * @param pSolCore              Pointer to the core object.
  * @param pcThreads             Number of threads read.
  * @param pfnWorker             Callback function for each thread.
@@ -1168,9 +1195,9 @@
  * @return IPRT status code.
  */
-static int rtCoreDumperForEachThread(PVBOXCORE pVBoxCore,  uint64_t *pcThreads, PFNCORETHREADWORKER pfnWorker)
-{
-    AssertPtrReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int rtCoreDumperForEachThread(PRTSOLCORE pSolCore,  uint64_t *pcThreads, PFNRTSOLCORETHREADWORKER pfnWorker)
+{
+    AssertPtrReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
     /*
@@ -1179,5 +1206,5 @@
      */
     char szLpsInfoPath[PATH_MAX];
-    RTStrPrintf(szLpsInfoPath, sizeof(szLpsInfoPath), "/proc/%d/lpsinfo", (int)pVBoxProc->Process);
+    RTStrPrintf(szLpsInfoPath, sizeof(szLpsInfoPath), "/proc/%d/lpsinfo", (int)pSolProc->Process);
 
     int rc = VINF_SUCCESS;
@@ -1185,12 +1212,10 @@
     if (fd >= 0)
     {
-        RTFILE hFile = (RTFILE)(uintptr_t)fd;
-        uint64_t u64Size;
-        RTFileGetSize(hFile, &u64Size);
-        size_t cbInfoHdrAndData = u64Size < ~(size_t)0 ? u64Size : ~(size_t)0;
-        void *pvInfoHdr = mmap(NULL, cbInfoHdrAndData, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1 /* fd */, 0 /* offset */);
+        size_t cbInfoHdrAndData = GetFileSizeByFd(fd);
+        void *pvInfoHdr = mmap(NULL, cbInfoHdrAndData, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON,
+                               -1 /* fd */, 0 /* offset */);
         if (pvInfoHdr != MAP_FAILED)
         {
-            rc = RTFileRead(hFile, pvInfoHdr, cbInfoHdrAndData, NULL);
+            rc = ReadFileNoIntr(fd, pvInfoHdr, cbInfoHdrAndData);
             if (RT_SUCCESS(rc))
             {
@@ -1199,5 +1224,5 @@
                 for (long i = 0; i < pHeader->pr_nent; i++)
                 {
-                    pfnWorker(pVBoxCore, pThreadInfo);
+                    pfnWorker(pSolCore, pThreadInfo);
                     pThreadInfo = (lwpsinfo_t *)((uintptr_t)pThreadInfo + pHeader->pr_entsize);
                 }
@@ -1210,5 +1235,5 @@
         else
             rc = VERR_NO_MEMORY;
-        RTFileClose(hFile);
+        close(fd);
     }
     else
@@ -1222,17 +1247,17 @@
  * Resume all threads of this process.
  *
- * @param pVBoxCore             Pointer to the core object.
+ * @param pSolCore              Pointer to the core object.
  *
  * @return IPRT status code..
  */
-static int rtCoreDumperResumeThreads(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
+static int rtCoreDumperResumeThreads(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
 
 #if 1
     uint64_t cThreads;
-    return rtCoreDumperForEachThread(pVBoxCore, &cThreads, resumeThread);
+    return rtCoreDumperForEachThread(pSolCore, &cThreads, resumeThread);
 #else
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
     char szCurThread[128];
@@ -1240,6 +1265,6 @@
     PRTDIR pDir = NULL;
 
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pVBoxProc->Process);
-    RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pVBoxProc->hCurThread);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pSolProc->Process);
+    RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pSolProc->hCurThread);
 
     int32_t cRunningThreads = 0;
@@ -1281,11 +1306,11 @@
  * Stop all running threads of this process except the current one.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int rtCoreDumperSuspendThreads(PVBOXCORE pVBoxCore)
-{
-    AssertPtrReturn(pVBoxCore, VERR_INVALID_POINTER);
+static int rtCoreDumperSuspendThreads(PRTSOLCORE pSolCore)
+{
+    AssertPtrReturn(pSolCore, VERR_INVALID_POINTER);
 
     /*
@@ -1303,5 +1328,5 @@
     for (cTries = 0; cTries < RT_ELEMENTS(aThreads); cTries++)
     {
-        rc = rtCoreDumperForEachThread(pVBoxCore, &aThreads[cTries], suspendThread);
+        rc = rtCoreDumperForEachThread(pSolCore, &aThreads[cTries], suspendThread);
         if (RT_FAILURE(rc))
             break;
@@ -1315,5 +1340,5 @@
     return rc;
 #else
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
     char szCurThread[128];
@@ -1321,6 +1346,6 @@
     PRTDIR pDir = NULL;
 
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pVBoxProc->Process);
-    RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pVBoxProc->hCurThread);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pSolProc->Process);
+    RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pSolProc->hCurThread);
 
     int rc = -1;
@@ -1391,5 +1416,5 @@
  * Write an ELF NOTE header into the core file.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param Type              Type of this NOTE section.
  * @param pcv               Opaque pointer to the data, if NULL only computes size.
@@ -1398,11 +1423,11 @@
  * @return IPRT status code.
  */
-static int ElfWriteNoteHeader(PVBOXCORE pVBoxCore, uint_t Type, const void *pcv, size_t cb)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
+static int ElfWriteNoteHeader(PRTSOLCORE pSolCore, uint_t Type, const void *pcv, size_t cb)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
     AssertReturn(pcv, VERR_INVALID_POINTER);
     AssertReturn(cb > 0, VERR_NO_DATA);
-    AssertReturn(pVBoxCore->pfnWriter, VERR_WRITE_ERROR);
-    AssertReturn(pVBoxCore->hCoreFile, VERR_INVALID_HANDLE);
+    AssertReturn(pSolCore->pfnWriter, VERR_WRITE_ERROR);
+    AssertReturn(pSolCore->fdCoreFile >= 0, VERR_INVALID_HANDLE);
 
     int rc = VERR_GENERAL_FAILURE;
@@ -1428,12 +1453,12 @@
      * Write note header and description.
      */
-    rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &ElfNoteHdr, sizeof(ElfNoteHdr));
+    rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &ElfNoteHdr, sizeof(ElfNoteHdr));
     if (RT_SUCCESS(rc))
     {
-       rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, pcv, cb);
+       rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, pcv, cb);
        if (RT_SUCCESS(rc))
        {
            if (cbAlign > cb)
-               rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, s_achPad, cbAlign - cb);
+               rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, s_achPad, cbAlign - cb);
        }
     }
@@ -1452,12 +1477,12 @@
  * Solaris has two types of program header information (new and old).
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param enmType           Type of core file information required.
  *
  * @return Size of NOTE section.
  */
-static size_t ElfNoteSectionSize(PVBOXCORE pVBoxCore, VBOXSOLCORETYPE enmType)
-{
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static size_t ElfNoteSectionSize(PRTSOLCORE pSolCore, RTSOLCORETYPE enmType)
+{
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     size_t cb = 0;
     switch (enmType)
@@ -1466,8 +1491,8 @@
         {
             cb += ElfNoteHeaderSize(sizeof(prpsinfo_t));
-            cb += ElfNoteHeaderSize(pVBoxProc->cAuxVecs * sizeof(auxv_t));
-            cb += ElfNoteHeaderSize(strlen(pVBoxProc->szPlatform));
-
-            PVBOXSOLTHREADINFO pThreadInfo = pVBoxProc->pThreadInfoHead;
+            cb += ElfNoteHeaderSize(pSolProc->cAuxVecs * sizeof(auxv_t));
+            cb += ElfNoteHeaderSize(strlen(pSolProc->szPlatform));
+
+            PRTSOLCORETHREADINFO pThreadInfo = pSolProc->pThreadInfoHead;
             while (pThreadInfo)
             {
@@ -1487,21 +1512,21 @@
             cb += ElfNoteHeaderSize(sizeof(psinfo_t));
             cb += ElfNoteHeaderSize(sizeof(pstatus_t));
-            cb += ElfNoteHeaderSize(pVBoxProc->cAuxVecs * sizeof(auxv_t));
-            cb += ElfNoteHeaderSize(strlen(pVBoxProc->szPlatform) + 1);
+            cb += ElfNoteHeaderSize(pSolProc->cAuxVecs * sizeof(auxv_t));
+            cb += ElfNoteHeaderSize(strlen(pSolProc->szPlatform) + 1);
             cb += ElfNoteHeaderSize(sizeof(struct utsname));
             cb += ElfNoteHeaderSize(sizeof(core_content_t));
-            cb += ElfNoteHeaderSize(pVBoxProc->cbCred);
-
-            if (pVBoxProc->pPriv)
-                cb += ElfNoteHeaderSize(PRIV_PRPRIV_SIZE(pVBoxProc->pPriv));   /* Ought to be same as cbPriv!? */
-
-            if (pVBoxProc->pcPrivImpl)
-                cb += ElfNoteHeaderSize(PRIV_IMPL_INFO_SIZE(pVBoxProc->pcPrivImpl));
-
-            cb += ElfNoteHeaderSize(strlen(pVBoxProc->szZoneName) + 1);
-            if (pVBoxProc->cbLdt > 0)
-                cb += ElfNoteHeaderSize(pVBoxProc->cbLdt);
-
-            PVBOXSOLTHREADINFO pThreadInfo = pVBoxProc->pThreadInfoHead;
+            cb += ElfNoteHeaderSize(pSolProc->cbCred);
+
+            if (pSolProc->pPriv)
+                cb += ElfNoteHeaderSize(PRIV_PRPRIV_SIZE(pSolProc->pPriv));   /* Ought to be same as cbPriv!? */
+
+            if (pSolProc->pcPrivImpl)
+                cb += ElfNoteHeaderSize(PRIV_IMPL_INFO_SIZE(pSolProc->pcPrivImpl));
+
+            cb += ElfNoteHeaderSize(strlen(pSolProc->szZoneName) + 1);
+            if (pSolProc->cbLdt > 0)
+                cb += ElfNoteHeaderSize(pSolProc->cbLdt);
+
+            PRTSOLCORETHREADINFO pThreadInfo = pSolProc->pThreadInfoHead;
             while (pThreadInfo)
             {
@@ -1531,18 +1556,18 @@
  * Solaris has two types of program  header information (new and old).
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param enmType           Type of core file information required.
  *
  * @return IPRT status code.
  */
-static int ElfWriteNoteSection(PVBOXCORE pVBoxCore, VBOXSOLCORETYPE enmType)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ElfWriteNoteSection(PRTSOLCORE pSolCore, RTSOLCORETYPE enmType)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     int rc = VERR_GENERAL_FAILURE;
 
 #ifdef RT_OS_SOLARIS
-    typedef int (*PFNELFWRITENOTEHDR)(PVBOXCORE pVBoxCore, uint_t, const void *pcv, size_t cb);
+    typedef int (*PFNELFWRITENOTEHDR)(PRTSOLCORE pSolCore, uint_t, const void *pcv, size_t cb);
     typedef struct ELFWRITENOTE
     {
@@ -1559,12 +1584,12 @@
             ELFWRITENOTE aElfNotes[] =
             {
-                { "NT_PRPSINFO", NT_PRPSINFO, &pVBoxProc->ProcInfoOld,  sizeof(prpsinfo_t) },
-                { "NT_AUXV",     NT_AUXV,      pVBoxProc->pAuxVecs,      pVBoxProc->cAuxVecs * sizeof(auxv_t) },
-                { "NT_PLATFORM", NT_PLATFORM,  pVBoxProc->szPlatform,    strlen(pVBoxProc->szPlatform) + 1 }
+                { "NT_PRPSINFO", NT_PRPSINFO, &pSolProc->ProcInfoOld,  sizeof(prpsinfo_t) },
+                { "NT_AUXV",     NT_AUXV,      pSolProc->pAuxVecs,      pSolProc->cAuxVecs * sizeof(auxv_t) },
+                { "NT_PLATFORM", NT_PLATFORM,  pSolProc->szPlatform,    strlen(pSolProc->szPlatform) + 1 }
             };
 
             for (unsigned i = 0; i < RT_ELEMENTS(aElfNotes); i++)
             {
-                rc = ElfWriteNoteHeader(pVBoxCore, aElfNotes[i].Type, aElfNotes[i].pcv, aElfNotes[i].cb);
+                rc = ElfWriteNoteHeader(pSolCore, aElfNotes[i].Type, aElfNotes[i].pcv, aElfNotes[i].cb);
                 if (RT_FAILURE(rc))
                 {
@@ -1578,5 +1603,5 @@
              * so we just skip if there is no status information for them.
              */
-            PVBOXSOLTHREADINFO pThreadInfo = pVBoxProc->pThreadInfoHead;
+            PRTSOLCORETHREADINFO pThreadInfo = pSolProc->pThreadInfoHead;
             for (; pThreadInfo; pThreadInfo = pThreadInfo->pNext)
             {
@@ -1585,9 +1610,9 @@
 
                 prstatus_t OldProcessStatus;
-                GetOldProcessStatus(pVBoxCore, &pThreadInfo->Info, pThreadInfo->pStatus, &OldProcessStatus);
-                rc = ElfWriteNoteHeader(pVBoxCore, NT_PRSTATUS, &OldProcessStatus, sizeof(prstatus_t));
+                GetOldProcessStatus(pSolCore, &pThreadInfo->Info, pThreadInfo->pStatus, &OldProcessStatus);
+                rc = ElfWriteNoteHeader(pSolCore, NT_PRSTATUS, &OldProcessStatus, sizeof(prstatus_t));
                 if (RT_SUCCESS(rc))
                 {
-                    rc = ElfWriteNoteHeader(pVBoxCore, NT_PRFPREG, &pThreadInfo->pStatus->pr_fpreg, sizeof(prfpregset_t));
+                    rc = ElfWriteNoteHeader(pSolCore, NT_PRFPREG, &pThreadInfo->pStatus->pr_fpreg, sizeof(prfpregset_t));
                     if (RT_FAILURE(rc))
                     {
@@ -1609,19 +1634,19 @@
             ELFWRITENOTE aElfNotes[] =
             {
-                { "NT_PSINFO",     NT_PSINFO,     &pVBoxProc->ProcInfo,     sizeof(psinfo_t) },
-                { "NT_PSTATUS",    NT_PSTATUS,    &pVBoxProc->ProcStatus,   sizeof(pstatus_t) },
-                { "NT_AUXV",       NT_AUXV,        pVBoxProc->pAuxVecs,     pVBoxProc->cAuxVecs * sizeof(auxv_t) },
-                { "NT_PLATFORM",   NT_PLATFORM,    pVBoxProc->szPlatform,   strlen(pVBoxProc->szPlatform) + 1 },
-                { "NT_UTSNAME",    NT_UTSNAME,    &pVBoxProc->UtsName,      sizeof(struct utsname) },
-                { "NT_CONTENT",    NT_CONTENT,    &pVBoxProc->CoreContent,  sizeof(core_content_t) },
-                { "NT_PRCRED",     NT_PRCRED,      pVBoxProc->pvCred,       pVBoxProc->cbCred },
-                { "NT_PRPRIV",     NT_PRPRIV,      pVBoxProc->pPriv,        PRIV_PRPRIV_SIZE(pVBoxProc->pPriv) },
-                { "NT_PRPRIVINFO", NT_PRPRIVINFO,  pVBoxProc->pcPrivImpl,   PRIV_IMPL_INFO_SIZE(pVBoxProc->pcPrivImpl) },
-                { "NT_ZONENAME",   NT_ZONENAME,    pVBoxProc->szZoneName,   strlen(pVBoxProc->szZoneName) + 1 }
+                { "NT_PSINFO",     NT_PSINFO,     &pSolProc->ProcInfo,     sizeof(psinfo_t) },
+                { "NT_PSTATUS",    NT_PSTATUS,    &pSolProc->ProcStatus,   sizeof(pstatus_t) },
+                { "NT_AUXV",       NT_AUXV,        pSolProc->pAuxVecs,     pSolProc->cAuxVecs * sizeof(auxv_t) },
+                { "NT_PLATFORM",   NT_PLATFORM,    pSolProc->szPlatform,   strlen(pSolProc->szPlatform) + 1 },
+                { "NT_UTSNAME",    NT_UTSNAME,    &pSolProc->UtsName,      sizeof(struct utsname) },
+                { "NT_CONTENT",    NT_CONTENT,    &pSolProc->CoreContent,  sizeof(core_content_t) },
+                { "NT_PRCRED",     NT_PRCRED,      pSolProc->pvCred,       pSolProc->cbCred },
+                { "NT_PRPRIV",     NT_PRPRIV,      pSolProc->pPriv,        PRIV_PRPRIV_SIZE(pSolProc->pPriv) },
+                { "NT_PRPRIVINFO", NT_PRPRIVINFO,  pSolProc->pcPrivImpl,   PRIV_IMPL_INFO_SIZE(pSolProc->pcPrivImpl) },
+                { "NT_ZONENAME",   NT_ZONENAME,    pSolProc->szZoneName,   strlen(pSolProc->szZoneName) + 1 }
             };
 
             for (unsigned i = 0; i < RT_ELEMENTS(aElfNotes); i++)
             {
-                rc = ElfWriteNoteHeader(pVBoxCore, aElfNotes[i].Type, aElfNotes[i].pcv, aElfNotes[i].cb);
+                rc = ElfWriteNoteHeader(pSolCore, aElfNotes[i].Type, aElfNotes[i].pcv, aElfNotes[i].cb);
                 if (RT_FAILURE(rc))
                 {
@@ -1635,8 +1660,8 @@
              * we only dump the lwpsinfo_t in that case.
              */
-            PVBOXSOLTHREADINFO pThreadInfo = pVBoxProc->pThreadInfoHead;
+            PRTSOLCORETHREADINFO pThreadInfo = pSolProc->pThreadInfoHead;
             for (; pThreadInfo; pThreadInfo = pThreadInfo->pNext)
             {
-                rc = ElfWriteNoteHeader(pVBoxCore, NT_LWPSINFO, &pThreadInfo->Info, sizeof(lwpsinfo_t));
+                rc = ElfWriteNoteHeader(pSolCore, NT_LWPSINFO, &pThreadInfo->Info, sizeof(lwpsinfo_t));
                 if (RT_FAILURE(rc))
                 {
@@ -1647,5 +1672,5 @@
                 if (pThreadInfo->pStatus)
                 {
-                    rc = ElfWriteNoteHeader(pVBoxCore, NT_LWPSTATUS, pThreadInfo->pStatus, sizeof(lwpstatus_t));
+                    rc = ElfWriteNoteHeader(pSolCore, NT_LWPSTATUS, pThreadInfo->pStatus, sizeof(lwpstatus_t));
                     if (RT_FAILURE(rc))
                     {
@@ -1675,14 +1700,14 @@
  * Write mappings into the core file.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int ElfWriteMappings(PVBOXCORE pVBoxCore)
-{
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ElfWriteMappings(PRTSOLCORE pSolCore)
+{
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
 
     int rc = VERR_GENERAL_FAILURE;
-    PVBOXSOLMAPINFO pMapInfo = pVBoxProc->pMapInfoHead;
+    PRTSOLCOREMAPINFO pMapInfo = pSolProc->pMapInfoHead;
     while (pMapInfo)
     {
@@ -1694,5 +1719,5 @@
             {
                 size_t cb = RT_MIN(sizeof(achBuf), pMapInfo->pMap.pr_size - k);
-                int rc2 = ProcReadAddrSpace(pVBoxProc, pMapInfo->pMap.pr_vaddr + k, &achBuf, cb);
+                int rc2 = ProcReadAddrSpace(pSolProc, pMapInfo->pMap.pr_vaddr + k, &achBuf, cb);
                 if (RT_FAILURE(rc2))
                 {
@@ -1701,5 +1726,5 @@
                 }
 
-                rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, achBuf, sizeof(achBuf));
+                rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, achBuf, sizeof(achBuf));
                 if (RT_FAILURE(rc))
                 {
@@ -1717,5 +1742,5 @@
             if (sizeof(achBuf) != pMapInfo->pMap.pr_size)
                 CORELOGRELSYS((CORELOG_NAME "ElfWriteMappings: Huh!? something is wrong!\n"));
-            rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &achBuf, sizeof(achBuf));
+            rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &achBuf, sizeof(achBuf));
             if (RT_FAILURE(rc))
             {
@@ -1735,13 +1760,13 @@
  * Write program headers for all mappings into the core file.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int ElfWriteMappingHeaders(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+static int ElfWriteMappingHeaders(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     Elf_Phdr ProgHdr;
     RT_ZERO(ProgHdr);
@@ -1749,9 +1774,9 @@
 
     int rc = VERR_GENERAL_FAILURE;
-    PVBOXSOLMAPINFO pMapInfo = pVBoxProc->pMapInfoHead;
+    PRTSOLCOREMAPINFO pMapInfo = pSolProc->pMapInfoHead;
     while (pMapInfo)
     {
         ProgHdr.p_vaddr  = pMapInfo->pMap.pr_vaddr;     /* Virtual address of this mapping in the process address space */
-        ProgHdr.p_offset = pVBoxCore->offWrite;         /* Where this mapping is located in the core file */
+        ProgHdr.p_offset = pSolCore->offWrite;         /* Where this mapping is located in the core file */
         ProgHdr.p_memsz  = pMapInfo->pMap.pr_size;      /* Size of the memory image of the mapping */
         ProgHdr.p_filesz = pMapInfo->pMap.pr_size;      /* Size of the file image of the mapping */
@@ -1768,5 +1793,5 @@
             ProgHdr.p_flags |= PF_SUNW_FAILURE;
 
-        rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &ProgHdr, sizeof(ProgHdr));
+        rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &ProgHdr, sizeof(ProgHdr));
         if (RT_FAILURE(rc))
         {
@@ -1775,5 +1800,5 @@
         }
 
-        pVBoxCore->offWrite += ProgHdr.p_filesz;
+        pSolCore->offWrite += ProgHdr.p_filesz;
         pMapInfo = pMapInfo->pNext;
     }
@@ -1786,22 +1811,22 @@
  * to be in suspended state (i.e. called after CreateCore).
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  * @param pfnWriter         Pointer to the writer function to override default writer (NULL uses default).
  *
  * @remarks Resumes all suspended threads, unless it's an invalid core. This
  *          function must be called only -after- rtCoreDumperCreateCore().
- * @return VBox status.
- */
-static int rtCoreDumperWriteCore(PVBOXCORE pVBoxCore, PFNCOREWRITER pfnWriter)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-
-    if (!pVBoxCore->fIsValid)
+ * @return IPRT status.
+ */
+static int rtCoreDumperWriteCore(PRTSOLCORE pSolCore, PFNRTCOREWRITER pfnWriter)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+
+    if (!pSolCore->fIsValid)
         return VERR_INVALID_STATE;
 
     if (pfnWriter)
-        pVBoxCore->pfnWriter = pfnWriter;
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
+        pSolCore->pfnWriter = pfnWriter;
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
     char szPath[PATH_MAX];
     int rc = VINF_SUCCESS;
@@ -1810,5 +1835,5 @@
      * Open the process address space file.
      */
-    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/as", (int)pVBoxProc->Process);
+    RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/as", (int)pSolProc->Process);
     int fd = open(szPath, O_RDONLY);
     if (fd < 0)
@@ -1819,21 +1844,21 @@
     }
 
-    pVBoxProc->hAs = (RTFILE)(uintptr_t)fd;
+    pSolProc->fdAs = fd;
 
     /*
      * Create the core file.
      */
-    fd = open(pVBoxCore->szCorePath, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR);
+    fd = open(pSolCore->szCorePath, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR);
     if (fd < 0)
     {
         rc = RTErrConvertFromErrno(fd);
-        CORELOGRELSYS((CORELOG_NAME "WriteCore: failed to open %s. rc=%Rrc\n", pVBoxCore->szCorePath, rc));
+        CORELOGRELSYS((CORELOG_NAME "WriteCore: failed to open %s. rc=%Rrc\n", pSolCore->szCorePath, rc));
         goto WriteCoreDone;
     }
 
-    pVBoxCore->hCoreFile = (RTFILE)(uintptr_t)fd;
-
-    pVBoxCore->offWrite = 0;
-    uint32_t cProgHdrs  = pVBoxProc->cMappings + 2; /* two PT_NOTE program headers (old, new style) */
+    pSolCore->fdCoreFile = fd;
+
+    pSolCore->offWrite = 0;
+    uint32_t cProgHdrs  = pSolProc->cMappings + 2; /* two PT_NOTE program headers (old, new style) */
 
     /*
@@ -1864,5 +1889,5 @@
     ElfHdr.e_phentsize       = sizeof(Elf_Phdr);
     ElfHdr.e_shentsize       = sizeof(Elf_Shdr);
-    rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &ElfHdr, sizeof(ElfHdr));
+    rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &ElfHdr, sizeof(ElfHdr));
     if (RT_FAILURE(rc))
     {
@@ -1882,8 +1907,8 @@
      * Write old-style NOTE program header.
      */
-    pVBoxCore->offWrite += sizeof(ElfHdr) + cProgHdrs * sizeof(ProgHdr);
-    ProgHdr.p_offset = pVBoxCore->offWrite;
-    ProgHdr.p_filesz = ElfNoteSectionSize(pVBoxCore, enmOldEra);
-    rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &ProgHdr, sizeof(ProgHdr));
+    pSolCore->offWrite += sizeof(ElfHdr) + cProgHdrs * sizeof(ProgHdr);
+    ProgHdr.p_offset = pSolCore->offWrite;
+    ProgHdr.p_filesz = ElfNoteSectionSize(pSolCore, enmOldEra);
+    rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &ProgHdr, sizeof(ProgHdr));
     if (RT_FAILURE(rc))
     {
@@ -1895,8 +1920,8 @@
      * Write new-style NOTE program header.
      */
-    pVBoxCore->offWrite += ProgHdr.p_filesz;
-    ProgHdr.p_offset = pVBoxCore->offWrite;
-    ProgHdr.p_filesz = ElfNoteSectionSize(pVBoxCore, enmNewEra);
-    rc = pVBoxCore->pfnWriter(pVBoxCore->hCoreFile, &ProgHdr, sizeof(ProgHdr));
+    pSolCore->offWrite += ProgHdr.p_filesz;
+    ProgHdr.p_offset = pSolCore->offWrite;
+    ProgHdr.p_filesz = ElfNoteSectionSize(pSolCore, enmNewEra);
+    rc = pSolCore->pfnWriter(pSolCore->fdCoreFile, &ProgHdr, sizeof(ProgHdr));
     if (RT_FAILURE(rc))
     {
@@ -1908,6 +1933,6 @@
      * Write program headers per mapping.
      */
-    pVBoxCore->offWrite += ProgHdr.p_filesz;
-    rc = ElfWriteMappingHeaders(pVBoxCore);
+    pSolCore->offWrite += ProgHdr.p_filesz;
+    rc = ElfWriteMappingHeaders(pSolCore);
     if (RT_FAILURE(rc))
     {
@@ -1919,5 +1944,5 @@
      * Write old-style note section.
      */
-    rc = ElfWriteNoteSection(pVBoxCore, enmOldEra);
+    rc = ElfWriteNoteSection(pSolCore, enmOldEra);
     if (RT_FAILURE(rc))
     {
@@ -1929,5 +1954,5 @@
      * Write new-style section.
      */
-    rc = ElfWriteNoteSection(pVBoxCore, enmNewEra);
+    rc = ElfWriteNoteSection(pSolCore, enmNewEra);
     if (RT_FAILURE(rc))
     {
@@ -1939,5 +1964,5 @@
      * Write all mappings.
      */
-    rc = ElfWriteMappings(pVBoxCore);
+    rc = ElfWriteMappings(pSolCore);
     if (RT_FAILURE(rc))
     {
@@ -1948,17 +1973,17 @@
 
 WriteCoreDone:
-    if (pVBoxCore->hCoreFile != NIL_RTFILE)     /* Initialized in rtCoreDumperCreateCore() */
-    {
-        RTFileClose(pVBoxCore->hCoreFile);
-        pVBoxCore->hCoreFile = NIL_RTFILE;
-    }
-
-    if (pVBoxProc->hAs != NIL_RTFILE)           /* Initialized in rtCoreDumperCreateCore() */
-    {
-        RTFileClose(pVBoxProc->hAs);
-        pVBoxProc->hAs = NIL_RTFILE;
-    }
-
-    rtCoreDumperResumeThreads(pVBoxCore);
+    if (pSolCore->fdCoreFile != -1)     /* Initialized in rtCoreDumperCreateCore() */
+    {
+        close(pSolCore->fdCoreFile);
+        pSolCore->fdCoreFile = -1;
+    }
+
+    if (pSolProc->fdAs != -1)           /* Initialized in rtCoreDumperCreateCore() */
+    {
+        close(pSolProc->fdAs);
+        pSolProc->fdAs = -1;
+    }
+
+    rtCoreDumperResumeThreads(pSolCore);
     return rc;
 }
@@ -1970,5 +1995,5 @@
  * are ultimately resumed en-masse) already suspended while calling this function.
  *
- * @param pVBoxCore         Pointer to a core object.
+ * @param pSolCore          Pointer to a core object.
  * @param pContext          Pointer to the caller context thread.
  * @param pszCoreFilePath   Path to the core file. If NULL is passed, the global
@@ -1978,7 +2003,7 @@
  * @return IPRT status code.
  */
-static int rtCoreDumperCreateCore(PVBOXCORE pVBoxCore, ucontext_t *pContext, const char *pszCoreFilePath)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
+static int rtCoreDumperCreateCore(PRTSOLCORE pSolCore, ucontext_t *pContext, const char *pszCoreFilePath)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
     AssertReturn(pContext, VERR_INVALID_POINTER);
 
@@ -1986,19 +2011,19 @@
      * Initialize core structures.
      */
-    memset(pVBoxCore, 0, sizeof(VBOXCORE));
-    pVBoxCore->pfnReader = &ReadFileNoIntr;
-    pVBoxCore->pfnWriter = &WriteFileNoIntr;
-    pVBoxCore->fIsValid  = false;
-    pVBoxCore->hCoreFile = NIL_RTFILE;
-
-    PVBOXPROCESS pVBoxProc = &pVBoxCore->VBoxProc;
-    pVBoxProc->Process        = RTProcSelf();
-    pVBoxProc->hCurThread     = _lwp_self(); /* thr_self() */
-    pVBoxProc->hAs            = NIL_RTFILE;
-    pVBoxProc->pCurThreadCtx  = pContext;
-    pVBoxProc->CoreContent    = CC_CONTENT_DEFAULT;
-
-    RTProcGetExecutablePath(pVBoxProc->szExecPath, sizeof(pVBoxProc->szExecPath));  /* this gets full path not just name */
-    pVBoxProc->pszExecName = RTPathFilename(pVBoxProc->szExecPath);
+    memset(pSolCore, 0, sizeof(RTSOLCORE));
+    pSolCore->pfnReader = &ReadFileNoIntr;
+    pSolCore->pfnWriter = &WriteFileNoIntr;
+    pSolCore->fIsValid  = false;
+    pSolCore->fdCoreFile = -1;
+
+    PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
+    pSolProc->Process        = RTProcSelf();
+    pSolProc->hCurThread     = _lwp_self(); /* thr_self() */
+    pSolProc->fdAs           = -1;
+    pSolProc->pCurThreadCtx  = pContext;
+    pSolProc->CoreContent    = CC_CONTENT_DEFAULT;
+
+    RTProcGetExecutablePath(pSolProc->szExecPath, sizeof(pSolProc->szExecPath));  /* this gets full path not just name */
+    pSolProc->pszExecName = RTPathFilename(pSolProc->szExecPath);
 
     /*
@@ -2016,34 +2041,34 @@
         {
             /* We cannot call RTPathAbs*() as they call getcwd() which calls malloc. */
-            RTStrPrintf(pVBoxCore->szCorePath, sizeof(pVBoxCore->szCorePath), "%s/core.vb.%s.%d",
-                        g_szCoreDumpDir, pVBoxProc->pszExecName, (int)pVBoxProc->Process);
+            RTStrPrintf(pSolCore->szCorePath, sizeof(pSolCore->szCorePath), "%s/core.vb.%s.%d",
+                        g_szCoreDumpDir, pSolProc->pszExecName, (int)pSolProc->Process);
         }
         else
-            RTStrPrintf(pVBoxCore->szCorePath, sizeof(pVBoxCore->szCorePath), "%s/core.vb.%s", g_szCoreDumpDir, g_szCoreDumpFile);
+            RTStrPrintf(pSolCore->szCorePath, sizeof(pSolCore->szCorePath), "%s/core.vb.%s", g_szCoreDumpDir, g_szCoreDumpFile);
     }
     else
-        RTStrCopy(pVBoxCore->szCorePath, sizeof(pVBoxCore->szCorePath), pszCoreFilePath);
-
-    CORELOG((CORELOG_NAME  "CreateCore: Taking Core %s from Thread %d\n", pVBoxCore->szCorePath, (int)pVBoxProc->hCurThread));
+        RTStrCopy(pSolCore->szCorePath, sizeof(pSolCore->szCorePath), pszCoreFilePath);
+
+    CORELOG((CORELOG_NAME  "CreateCore: Taking Core %s from Thread %d\n", pSolCore->szCorePath, (int)pSolProc->hCurThread));
 
     /*
      * Quiesce the process.
      */
-    int rc = rtCoreDumperSuspendThreads(pVBoxCore);
+    int rc = rtCoreDumperSuspendThreads(pSolCore);
     if (RT_SUCCESS(rc))
     {
-        rc = ProcReadInfo(pVBoxCore);
+        rc = ProcReadInfo(pSolCore);
         if (RT_SUCCESS(rc))
         {
-            GetOldProcessInfo(pVBoxCore, &pVBoxProc->ProcInfoOld);
-            if (IsProcessArchNative(pVBoxProc))
+            GetOldProcessInfo(pSolCore, &pSolProc->ProcInfoOld);
+            if (IsProcessArchNative(pSolProc))
             {
                 /*
                  * Read process status, information such as number of active LWPs will be invalid since we just quiesced the process.
                  */
-                rc = ProcReadStatus(pVBoxCore);
+                rc = ProcReadStatus(pSolCore);
                 if (RT_SUCCESS(rc))
                 {
-                    rc = AllocMemoryArea(pVBoxCore);
+                    rc = AllocMemoryArea(pSolCore);
                     if (RT_SUCCESS(rc))
                     {
@@ -2051,5 +2076,5 @@
                         {
                             const char        *pszName;
-                            PFNCOREACCUMULATOR pfnAcc;
+                            PFNRTSOLCOREACCUMULATOR pfnAcc;
                             bool               fOptional;
                         } aAccumulators[] =
@@ -2066,5 +2091,5 @@
                         for (unsigned i = 0; i < RT_ELEMENTS(aAccumulators); i++)
                         {
-                            rc = aAccumulators[i].pfnAcc(pVBoxCore);
+                            rc = aAccumulators[i].pfnAcc(pSolCore);
                             if (RT_FAILURE(rc))
                             {
@@ -2077,9 +2102,9 @@
                         if (RT_SUCCESS(rc))
                         {
-                            pVBoxCore->fIsValid = true;
+                            pSolCore->fIsValid = true;
                             return VINF_SUCCESS;
                         }
 
-                        FreeMemoryArea(pVBoxCore);
+                        FreeMemoryArea(pSolCore);
                     }
                     else
@@ -2101,5 +2126,5 @@
          * Resume threads on failure.
          */
-        rtCoreDumperResumeThreads(pVBoxCore);
+        rtCoreDumperResumeThreads(pSolCore);
     }
     else
@@ -2113,16 +2138,16 @@
  * Destroy an existing core object.
  *
- * @param pVBoxCore         Pointer to the core object.
+ * @param pSolCore          Pointer to the core object.
  *
  * @return IPRT status code.
  */
-static int rtCoreDumperDestroyCore(PVBOXCORE pVBoxCore)
-{
-    AssertReturn(pVBoxCore, VERR_INVALID_POINTER);
-    if (!pVBoxCore->fIsValid)
+static int rtCoreDumperDestroyCore(PRTSOLCORE pSolCore)
+{
+    AssertReturn(pSolCore, VERR_INVALID_POINTER);
+    if (!pSolCore->fIsValid)
         return VERR_INVALID_STATE;
 
-    FreeMemoryArea(pVBoxCore);
-    pVBoxCore->fIsValid = false;
+    FreeMemoryArea(pSolCore);
+    pSolCore->fIsValid = false;
     return VINF_SUCCESS;
 }
@@ -2152,16 +2177,16 @@
      * Any errors would resume all threads if they were halted.
      */
-    VBOXCORE VBoxCore;
-    RT_ZERO(VBoxCore);
-    int rc = rtCoreDumperCreateCore(&VBoxCore, pContext, pszOutputFile);
+    RTSOLCORE SolCore;
+    RT_ZERO(SolCore);
+    int rc = rtCoreDumperCreateCore(&SolCore, pContext, pszOutputFile);
     if (RT_SUCCESS(rc))
     {
-        rc = rtCoreDumperWriteCore(&VBoxCore, &WriteFileNoIntr);
+        rc = rtCoreDumperWriteCore(&SolCore, &WriteFileNoIntr);
         if (RT_SUCCESS(rc))
-            CORELOGRELSYS((CORELOG_NAME "Core dumped in %s\n", VBoxCore.szCorePath));
+            CORELOGRELSYS((CORELOG_NAME "Core dumped in %s\n", SolCore.szCorePath));
         else
-            CORELOGRELSYS((CORELOG_NAME "TakeDump: WriteCore failed. szCorePath=%s rc=%Rrc\n", VBoxCore.szCorePath, rc));
-
-        rtCoreDumperDestroyCore(&VBoxCore);
+            CORELOGRELSYS((CORELOG_NAME "TakeDump: WriteCore failed. szCorePath=%s rc=%Rrc\n", SolCore.szCorePath, rc));
+
+        rtCoreDumperDestroyCore(&SolCore);
     }
     else
Index: /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.h
===================================================================
--- /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.h	(revision 37630)
+++ /trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.h	(revision 37631)
@@ -1,9 +1,9 @@
 /* $Id$ */
 /** @file
- * IPRT Testcase - Core dump, header.
+ * IPRT - Custom Core Dumper, Solaris.
  */
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -25,6 +25,5 @@
  */
 
-#include <iprt/process.h>
-#include <iprt/file.h>
+#include <iprt/types.h>
 
 #ifdef RT_OS_SOLARIS
@@ -62,97 +61,98 @@
 #ifdef RT_OS_SOLARIS
 /**
- * VBOXSOLMAPINFO: Memory mapping description.
+ * Memory mapping descriptor employed by the solaris core dumper.
  */
-typedef struct VBOXSOLMAPINFO
+typedef struct RTSOLCOREMAPINFO
 {
-    prmap_t                         pMap;                       /* Proc description of this mapping */
-    int                             fError;                     /* Any error reading this mapping (errno) */
-    struct VBOXSOLMAPINFO          *pNext;                      /* Pointer to the next mapping */
-} VBOXSOLMAPINFO;
-typedef VBOXSOLMAPINFO *PVBOXSOLMAPINFO;
+    prmap_t                         pMap;                       /**< Proc description of this mapping */
+    int                             fError;                     /**< Any error reading this mapping (errno) */
+    struct RTSOLCOREMAPINFO            *pNext;                      /**< Pointer to the next mapping */
+} RTSOLCOREMAPINFO;
+/** Pointer to a solaris memory mapping descriptor. */
+typedef RTSOLCOREMAPINFO *PRTSOLCOREMAPINFO;
 
 /**
- * VBOXSOLCORETYPE: Whether this is an old or new style core.
+ * Whether this is an old or new style solaris core.
  */
-typedef enum VBOXSOLCORETYPE
+typedef enum RTSOLCORETYPE
 {
-    enmOldEra       = 0x01d,        /* old */
-    enmNewEra       = 0x5c1f1       /* sci-fi */
-} VBOXSOLCORETYPE;
+    enmOldEra = 0x01d,   /**< old */
+    enmNewEra = 0x5c1f1  /**< sci-fi */
+} RTSOLCORETYPE;
 
 /**
- * VBOXSOLTHREADINFO: Per-Thread information.
+ * Per-Thread information employed by the solaris core dumper.
  */
-typedef struct VBOXSOLTHREADINFO
+typedef struct RTSOLCORETHREADINFO
 {
-    lwpsinfo_t                      Info;                       /* Proc description of this thread */
-    lwpstatus_t                    *pStatus;                    /* Proc description of this thread's status (can be NULL, zombie lwp) */
-    struct VBOXSOLTHREADINFO       *pNext;                      /* Pointer to the next thread */
-} VBOXSOLTHREADINFO;
-typedef VBOXSOLTHREADINFO *PVBOXSOLTHREADINFO;
+    lwpsinfo_t                      Info;                       /**< Proc description of this thread */
+    lwpstatus_t                    *pStatus;                    /**< Proc description of this thread's status (can be NULL, zombie lwp) */
+    struct RTSOLCORETHREADINFO     *pNext;                      /**< Pointer to the next thread */
+} RTSOLCORETHREADINFO;
+typedef RTSOLCORETHREADINFO *PRTSOLCORETHREADINFO;
 #endif
 
 
 /**
- * VBOXPROCESS: Current (also the core target) process information.
+ * Current (also the core target) process information.
  */
-typedef struct VBOXPROCESS
+typedef struct RTSOLCOREPROCESS
 {
-    RTPROCESS                       Process;                    /* The pid of the process */
-    char                            szExecPath[PATH_MAX];       /* Path of the executable */
-    char                           *pszExecName;                /* Name of the executable file */
+    RTPROCESS                       Process;                    /**< The pid of the process */
+    char                            szExecPath[PATH_MAX];       /**< Path of the executable */
+    char                           *pszExecName;                /**< Name of the executable file */
 #ifdef RT_OS_SOLARIS
-    psinfo_t                        ProcInfo;                   /* Process info. */
-    prpsinfo_t                      ProcInfoOld;                /* Process info. Older version (for GDB compat.) */
-    pstatus_t                       ProcStatus;                 /* Process status info. */
-    thread_t                        hCurThread;                 /* The current thread */
-    ucontext_t                     *pCurThreadCtx;              /* Context info. of current thread before starting to dump */
-    RTFILE                          hAs;                        /* proc/<pid/as file handle */
-    auxv_t                         *pAuxVecs;                   /* Aux vector of process */
-    int                             cAuxVecs;                   /* Number of aux vector entries */
-    PVBOXSOLMAPINFO                 pMapInfoHead;               /* Pointer to the head of list of mappings */
-    uint32_t                        cMappings;                  /* Number of mappings (count of pMapInfoHead list) */
-    PVBOXSOLTHREADINFO              pThreadInfoHead;            /* Pointer to the head of list of threads */
-    uint64_t                        cThreads;                   /* Number of threads (count of pThreadInfoHead list) */
-    char                            szPlatform[SYS_NMLN];       /* Platform name  */
-    char                            szZoneName[ZONENAME_MAX];   /* Zone name */
-    struct utsname                  UtsName;                    /* UTS name */
-    void                           *pvCred;                     /* Process credential info. */
-    size_t                          cbCred;                     /* Size of process credential info. */
-    void                           *pvLdt;                      /* Process LDT info. */
-    size_t                          cbLdt;                      /* Size of the LDT info. */
-    prpriv_t                       *pPriv;                      /* Process privilege info. */
-    size_t                          cbPriv;                     /* Size of process privilege info. */
-    const priv_impl_info_t         *pcPrivImpl;                 /* Process privilege implementation info. (opaque handle) */
-    core_content_t                  CoreContent;                /* What information goes in the core */
+    psinfo_t                        ProcInfo;                   /**< Process info. */
+    prpsinfo_t                      ProcInfoOld;                /**< Process info. Older version (for GDB compat.) */
+    pstatus_t                       ProcStatus;                 /**< Process status info. */
+    thread_t                        hCurThread;                 /**< The current thread */
+    ucontext_t                     *pCurThreadCtx;              /**< Context info. of current thread before starting to dump */
+    int                             fdAs;                       /**< proc/pid/as file handle */
+    auxv_t                         *pAuxVecs;                   /**< Aux vector of process */
+    int                             cAuxVecs;                   /**< Number of aux vector entries */
+    PRTSOLCOREMAPINFO               pMapInfoHead;               /**< Pointer to the head of list of mappings */
+    uint32_t                        cMappings;                  /**< Number of mappings (count of pMapInfoHead list) */
+    PRTSOLCORETHREADINFO            pThreadInfoHead;            /**< Pointer to the head of list of threads */
+    uint64_t                        cThreads;                   /**< Number of threads (count of pThreadInfoHead list) */
+    char                            szPlatform[SYS_NMLN];       /**< Platform name  */
+    char                            szZoneName[ZONENAME_MAX];   /**< Zone name */
+    struct utsname                  UtsName;                    /**< UTS name */
+    void                           *pvCred;                     /**< Process credential info. */
+    size_t                          cbCred;                     /**< Size of process credential info. */
+    void                           *pvLdt;                      /**< Process LDT info. */
+    size_t                          cbLdt;                      /**< Size of the LDT info. */
+    prpriv_t                       *pPriv;                      /**< Process privilege info. */
+    size_t                          cbPriv;                     /**< Size of process privilege info. */
+    const priv_impl_info_t         *pcPrivImpl;                 /**< Process privilege implementation info. (opaque handle) */
+    core_content_t                  CoreContent;                /**< What information goes in the core */
 #else
 # error Port Me!
 #endif
 
-} VBOXPROCESS;
-typedef VBOXPROCESS *PVBOXPROCESS;
+} RTSOLCOREPROCESS;
+typedef RTSOLCOREPROCESS *PRTSOLCOREPROCESS;
 
-typedef int (*PFNCOREREADER)(RTFILE hFile, void *pv, size_t cb);
-typedef int (*PFNCOREWRITER)(RTFILE hFile, const void *pcv, size_t cb);
+typedef int (*PFNRTCOREREADER)(int fdFile, void *pv, size_t cb);
+typedef int (*PFNRTCOREWRITER)(int fdhFile, const void *pcv, size_t cb);
 
 /**
- * VBOXCORE: Core file object.
+ * The solaris core file object.
  */
-typedef struct VBOXCORE
+typedef struct RTSOLCORE
 {
-    char                            szCorePath[PATH_MAX];       /* Path of the core file */
-    VBOXPROCESS                     VBoxProc;                   /* Current process information */
-    void                           *pvCore;                     /* Pointer to memory area during dumping */
-    size_t                          cbCore;                     /* Size of memory area during dumping */
-    void                           *pvFree;                     /* Pointer to base of free range in preallocated memory area */
-    bool                            fIsValid;                   /* Whether core information has been fully collected */
-    PFNCOREREADER                   pfnReader;                  /* Reader function */
-    PFNCOREWRITER                   pfnWriter;                  /* Writer function */
-    RTFILE                          hCoreFile;                  /* Core file (used only while writing the core) */
-    RTFOFF                          offWrite;                   /* Segment/section offset (used only while writing the core) */
-} VBOXCORE;
-typedef VBOXCORE *PVBOXCORE;
+    char                            szCorePath[PATH_MAX];       /**< Path of the core file */
+    RTSOLCOREPROCESS                SolProc;                    /**< Current process information */
+    void                           *pvCore;                     /**< Pointer to memory area during dumping */
+    size_t                          cbCore;                     /**< Size of memory area during dumping */
+    void                           *pvFree;                     /**< Pointer to base of free range in preallocated memory area */
+    bool                            fIsValid;                   /**< Whether core information has been fully collected */
+    PFNRTCOREREADER                 pfnReader;                  /**< Reader function */
+    PFNRTCOREWRITER                 pfnWriter;                  /**< Writer function */
+    int                             fdCoreFile;                 /**< Core file (used only while writing the core) */
+    RTFOFF                          offWrite;                   /**< Segment/section offset (used only while writing the core) */
+} RTSOLCORE;
+typedef RTSOLCORE *PRTSOLCORE;
 
-typedef int (*PFNCOREACCUMULATOR)(PVBOXCORE pVBoxCore);
-typedef int (*PFNCORETHREADWORKER)(PVBOXCORE pVBoxCore, void *pvThreadInfo);
+typedef int (*PFNRTSOLCOREACCUMULATOR)(PRTSOLCORE pSolCore);
+typedef int (*PFNRTSOLCORETHREADWORKER)(PRTSOLCORE pSolCore, void *pvThreadInfo);
 
Index: /trunk/src/VBox/Runtime/testcase/tstRTCoreDump.cpp
===================================================================
--- /trunk/src/VBox/Runtime/testcase/tstRTCoreDump.cpp	(revision 37630)
+++ /trunk/src/VBox/Runtime/testcase/tstRTCoreDump.cpp	(revision 37631)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -28,10 +28,10 @@
 *   Header Files                                                               *
 *******************************************************************************/
-#include <iprt/types.h>
+#include <iprt/coredumper.h>
+
+#include <iprt/test.h>
 #include <iprt/err.h>
 #include <iprt/initterm.h>
 #include <iprt/thread.h>
-#include <iprt/stream.h>
-#include <iprt/coredumper.h>
 
 
@@ -39,10 +39,8 @@
 *   Globals                                                                    *
 *******************************************************************************/
-static unsigned volatile g_cErrors = 0;
-
-static DECLCALLBACK(int) SleepyThread(RTTHREAD Thread, void *pvUser)
+static DECLCALLBACK(int) SleepyThread(RTTHREAD hThread, void *pvUser)
 {
     NOREF(pvUser);
-    RTThreadSleep(90000000);
+    RTThreadUserWait(hThread, 90000000);
     return VINF_SUCCESS;
 }
@@ -50,11 +48,16 @@
 int main()
 {
-    RTR3Init();
-    RTPrintf("tstRTCoreDump: TESTING...\n");
+    RTTEST     hTest;
+    RTEXITCODE rcExit = RTTestInitAndCreate("tstRTCoreDump", &hTest);
+    if (rcExit != RTEXITCODE_SUCCESS)
+        return rcExit;
+    RTTestBanner(hTest);
 
     /*
      * Setup core dumping.
      */
-    int rc = RTCoreDumperSetup(NULL, RTCOREDUMPER_FLAGS_REPLACE_SYSTEM_DUMP | RTCOREDUMPER_FLAGS_LIVE_CORE);
+    int rc;
+    RTTESTI_CHECK_RC(rc = RTCoreDumperSetup(NULL, RTCOREDUMPER_FLAGS_REPLACE_SYSTEM_DUMP | RTCOREDUMPER_FLAGS_LIVE_CORE),
+                     VINF_SUCCESS);
     if (RT_SUCCESS(rc))
     {
@@ -63,33 +66,27 @@
          */
         RTTHREAD ahThreads[5];
-        unsigned i = 0;
-        for (; i < RT_ELEMENTS(ahThreads); i++)
+        unsigned i;
+        for (i = 0; i < RT_ELEMENTS(ahThreads); i++)
         {
-            rc = RTThreadCreate(&ahThreads[i], SleepyThread, &ahThreads[i], 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, "TEST1");
-            if (RT_FAILURE(rc))
-            {
-                RTPrintf("tstRTCoreDump: FAILURE(%d) - %d RTThreadCreate failed, rc=%Rrc\n", __LINE__, i, rc);
-                g_cErrors++;
-                ahThreads[i] = NIL_RTTHREAD;
-                break;
-            }
+            RTTESTI_CHECK_RC_BREAK(RTThreadCreate(&ahThreads[i], SleepyThread, &ahThreads[i], 0, RTTHREADTYPE_DEFAULT,
+                                                  RTTHREADFLAGS_WAITABLE, "TEST1"),
+                                   VINF_SUCCESS);
         }
-        RTPrintf("Spawned %d threads.\n", i);
+        RTTestIPrintf(RTTESTLVL_ALWAYS, "Spawned %d threads.\n", i);
 
         /*
          * Write the core to disk.
          */
-        rc = RTCoreDumperTakeDump(NULL, false /* fLiveCore*/);
-        if (RT_FAILURE(rc))
+        RTTESTI_CHECK_RC(RTCoreDumperTakeDump(NULL, true /* fLiveCore*/), VINF_SUCCESS);
+
+        /*
+         * Clean up.
+         */
+        RTTESTI_CHECK_RC(RTCoreDumperDisable(), VINF_SUCCESS);
+        while (i-- > 0)
         {
-            g_cErrors++;
-            RTPrintf("RTCoreDumperTakeDump failed. rc=%Rrc\n", rc);
+            RTTESTI_CHECK_RC(RTThreadUserSignal(ahThreads[i]), VINF_SUCCESS);
+            RTTESTI_CHECK_RC(RTThreadWait(ahThreads[i], 60*1000, NULL), VINF_SUCCESS);
         }
-        RTCoreDumperDisable();
-    }
-    else
-    {
-        g_cErrors++;
-        RTPrintf("RTCoreDumperSetup failed. rc=%Rrc\n", rc);
     }
 
@@ -97,10 +94,5 @@
      * Summary.
      */
-    if (!g_cErrors)
-        RTPrintf("tstRTCoreDump: SUCCESS\n");
-    else
-        RTPrintf("tstRTCoreDump: FAILURE - %d errors\n", g_cErrors);
-
-    return !!g_cErrors;
+    return RTTestSummaryAndDestroy(hTest);
 }
 
