#include <SharedMemoryImp.hpp>
◆ SharedMemoryImp() [1/2]
geopm::SharedMemoryImp::SharedMemoryImp |
( |
| ) |
|
◆ ~SharedMemoryImp()
geopm::SharedMemoryImp::~SharedMemoryImp |
( |
| ) |
|
|
virtual |
Destructor destroys and unlinks the shared memory region.
◆ SharedMemoryImp() [2/2]
◆ attach_memory_region()
void geopm::SharedMemoryImp::attach_memory_region |
( |
const std::string & |
shm_key, |
|
|
unsigned int |
timeout |
|
) |
| |
Takes a key and attempts to attach to a inter-process shared memory region. This version of the constructor tries to attach multiple times until a timeout is reached.
- Parameters
-
[in] | shm_key | Shared memory key to attach to the region. |
[in] | timeout | Length in seconds to keep retrying the attachment process to a shared memory region. |
◆ chown()
void geopm::SharedMemoryImp::chown |
( |
const unsigned int |
uid, |
|
|
const unsigned int |
gid |
|
) |
| const |
|
overridevirtual |
Modifies the shared memory to be owned by the specified gid.
- Parameters
-
[in] | uid | User ID to become owner. |
[in] | gid | Group ID to become owner. |
Implements geopm::SharedMemory.
◆ construct_shm_path()
std::string geopm::SharedMemoryImp::construct_shm_path |
( |
const std::string & |
key | ) |
|
|
static |
Construct the file path to use for the provided key.
◆ create_memory_region()
void geopm::SharedMemoryImp::create_memory_region |
( |
const std::string & |
shm_key, |
|
|
size_t |
size, |
|
|
bool |
is_secure |
|
) |
| |
Takes a key and a size and creates an inter-process shared memory region.
- Parameters
-
[in] | shm_key | Shared memory key to create the region. |
[in] | size | Size of the region to create. |
[in] | is_secure | Disallow group and world r/w if true. |
◆ get_scoped_lock()
Attempt to lock the mutex for the shared memory region and return a scoped mutex object that will unlock the mutex when it goes out of scope.
This method should be called before accessing the memory with pointer()
Implements geopm::SharedMemory.
◆ key()
std::string geopm::SharedMemoryImp::key |
( |
void |
| ) |
const |
|
overridevirtual |
Retrieve the key to the shared memory region.
- Returns
- Key to the shared memory region.
Implements geopm::SharedMemory.
◆ operator=()
◆ pointer()
void * geopm::SharedMemoryImp::pointer |
( |
void |
| ) |
const |
|
overridevirtual |
Retrieve a pointer to the shared memory region.
- Returns
- Void pointer to the shared memory region.
Implements geopm::SharedMemory.
◆ size()
size_t geopm::SharedMemoryImp::size |
( |
void |
| ) |
const |
|
overridevirtual |
Retrieve the size of the shared memory region.
- Returns
- Size of the shared memory region.
Implements geopm::SharedMemory.
◆ unlink()
void geopm::SharedMemoryImp::unlink |
( |
void |
| ) |
|
|
overridevirtual |
The documentation for this class was generated from the following files: