SUPLib-freebsd.cpp revision fbce7e4e7123ca200586ee9257a12d663e928841
/** @file
* SUPLib - FreeBSD Hosts,
*/
/*
* Copyright (C) 2006-2007 innotek GmbH
*
* 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 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include "SUPLibInternal.h"
#include "SUPDRVIOC.h"
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/** BSD Device name. */
#define DEVICE_NAME "/dev/vboxdrv"
/*******************************************************************************
* Global Variables *
*******************************************************************************/
/** Handle to the open device. */
static int g_hDevice = -1;
{
/*
* Check if already initialized.
*/
if (g_hDevice >= 0)
return VINF_SUCCESS;
/*
* Try open the BSD device.
*/
if (g_hDevice < 0)
{
return RTErrConvertFromErrno(rc);
}
/*
* We're done.
*/
return VINF_SUCCESS;
}
int suplibOsTerm(void)
{
/*
* Check if we're initited at all.
*/
if (g_hDevice >= 0)
{
AssertFailed();
g_hDevice = -1;
}
return VINF_SUCCESS;
}
int suplibOsInstall(void)
{
return VERR_NOT_IMPLEMENTED;
}
int suplibOsUninstall(void)
{
return VERR_NOT_IMPLEMENTED;
}
{
return VINF_SUCCESS;
return RTErrConvertFromErrno(errno);
}
#ifdef VBOX_WITHOUT_IDT_PATCHING
{
if (rc == -1)
return rc;
}
#endif
{
if (*ppvPages)
return VINF_SUCCESS;
return RTErrConvertFromErrno(errno);
}
{
return VINF_SUCCESS;
}