rtmemlocked-posix.cpp revision cb62273b023a1efb7864e02410a10fce430bc050
/* $Id$ */
/** @file
* IPRT - RTMemLocked*, POSIX.
*/
/*
* Copyright (C) 2014 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
/*******************************************************************************
* Defined Constants And Macros *
*******************************************************************************/
/*******************************************************************************
* Structures and Typedefs *
*******************************************************************************/
/**
* Header for a locked memory region.
*/
typedef struct RTMEMLOCKEDHDR
{
/** Magic value. */
/** Size of the region in bytes including the header, rounded to a page aligned value. */
#if HC_ARCH_BITS == 64
/** 8 byte alignment of the structure on 64bit platforms. */
#endif
/** Pointer to a locked memory region header. */
typedef RTMEMLOCKEDHDR *PRTMEMLOCKEDHDR;
/** Magic for the header. (Vienna Teng) */
{
int rc = VINF_SUCCESS;
void *pv;
-1, 0);
if (pv != MAP_FAILED)
{
if (!rcPosix)
{
}
else
}
return rc;
}
{
if (RT_SUCCESS(rc))
{
}
return rc;
}
{
if (RT_FAILURE(rc))
return NULL;
return pv;
}
{
if (RT_FAILURE(rc))
return NULL;
return pv;
}
{
/*
* Validate & adjust the input.
*/
if (!pv)
return;
int rcPosix;
}