pstore2
Classes | Functions
shared_memory.hpp File Reference
#include <atomic>
#include <cstring>
#include <mutex>
#include <sstream>
#include <cerrno>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include "pstore/os/uint64.hpp"
#include "pstore/support/error.hpp"
#include "pstore/support/quoted.hpp"
Include dependency graph for shared_memory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pstore::shared_memory< Ty >
 Opens a shared memory object containing type Ty with the given name. More...
 

Functions

std::size_t pstore::get_pshmnamlen () noexcept
 A function which returns the maximum length of a shared memory object name.
 
template<typename SpanType >
auto pstore::posix::shm_name (std::string const &name, SpanType arr) -> ::pstore::gsl::zstring
 
template<std::size_t N>
auto pstore::posix::shm_name (std::string const &name, std::array< char, N > &arr) -> ::pstore::gsl::zstring
 

Function Documentation

◆ shm_name()

template<typename SpanType >
auto pstore::posix::shm_name ( std::string const &  name,
SpanType  arr 
) -> ::pstore::gsl::zstring

Used to build a name beginning with a slash character for a POSIX shared memory object. Following the initial slash, as many characters as possible from 'name' are copied to the output array (arr) followed by a terminating null.

Parameters
nameThe name to be copied
arrAn array into which the characters are copied.
Returns
A pointer to the output null-terminated string. Equivalent to arr.data ().