vbox-libdlpi.cpp revision 8b64716512fa358e47ae216141280a27604a3e78
/** $Id$ */
/** @file
* Dynamically load libdpli & symbols on Solaris hosts, Internal header.
*/
/*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#include "vbox-libdlpi.h"
/**
* Global pointer to the libdlpi module. This should only be set once all needed libraries
* and symbols have been successfully loaded.
*/
/**
* Whether we have tried to load libdlpi yet. This flag should only be set
* to "true" after we have either loaded both libraries and all symbols which we need,
* or failed to load something and unloaded.
*/
static bool g_fCheckedForLibDlpi = false;
/** All the symbols we need from libdlpi.
* @{
*/
void (*g_pfnLibDlpiClose)(dlpi_handle_t);
int (*g_pfnLibDlpiFd)(dlpi_handle_t);
/** @} */
bool VBoxLibDlpiFound(void)
{
if (g_hLibDlpi && g_fCheckedForLibDlpi)
return true;
if (g_fCheckedForLibDlpi)
return false;
return false;
)
{
g_fCheckedForLibDlpi = true;
return true;
}
else
{
g_fCheckedForLibDlpi = true;
return false;
}
}