coredumper-solaris.h revision c58f1213e628a545081c70e26c6b67a841cff880
/* $Id$ */
/** @file
* IPRT - Custom Core Dumper, Solaris.
*/
/*
* Copyright (C) 2010-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
#ifdef RT_OS_SOLARIS
/*
* Solaris' procfs cannot be used with large file environment in 32-bit.
*/
# define _FILE_OFFSET_BITS 32
# include <procfs.h>
# include <sys/old_procfs.h>
# define _FILE_OFFSET_BITS 64
#else
# include <procfs.h>
# include <sys/old_procfs.h>
#endif
# include <limits.h>
# include <thread.h>
#ifdef RT_ARCH_AMD64
# define _ELF64
#endif
#endif
#ifdef RT_OS_SOLARIS
/**
* Memory mapping descriptor employed by the solaris core dumper.
*/
typedef struct RTSOLCOREMAPINFO
{
int fError; /**< Any error reading this mapping (errno) */
/** Pointer to a solaris memory mapping descriptor. */
typedef RTSOLCOREMAPINFO *PRTSOLCOREMAPINFO;
/**
* Whether this is an old or new style solaris core.
*/
typedef enum RTSOLCORETYPE
{
/**
* Per-Thread information employed by the solaris core dumper.
*/
typedef struct RTSOLCORETHREADINFO
{
typedef RTSOLCORETHREADINFO *PRTSOLCORETHREADINFO;
#endif
/**
* Current (also the core target) process information.
*/
typedef struct RTSOLCOREPROCESS
{
char *pszExecName; /**< Name of the executable file */
#ifdef RT_OS_SOLARIS
int cAuxVecs; /**< Number of aux vector entries */
void *pvCred; /**< Process credential info. */
void *pvLdt; /**< Process LDT info. */
#else
#endif
typedef RTSOLCOREPROCESS *PRTSOLCOREPROCESS;
/**
* The solaris core file object.
*/
typedef struct RTSOLCORE
{
void *pvCore; /**< Pointer to 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 */
int fdCoreFile; /**< Core file (used only while writing the core) */
} RTSOLCORE;
typedef RTSOLCORE *PRTSOLCORE;