vbox-libdlpi.cpp revision e64031e20c39650a7bc902a3e1aba613b9415dee
/** $Id$ */
/** @file
* Dynamically load libdpli & symbols on Solaris hosts, Internal header.
*/
/*
* Copyright (C) 2008 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.
*/
#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;
}
}