19 #include "core/exception.hpp"
20 #include "core/sizeof_void.hpp"
21 #include "core/syscall_wrapper.hpp"
71 T *
get()
noexcept(
false);
75 T
const *
get()
const noexcept(
false);
82 const std::string name_;
83 const std::size_t length_;
87 static handle_t open_fd(
std::string
const &name, oflags_type oflags,
mode_type mode)
noexcept(
false);
88 static void *map_fd(handle_t fd,
std::size_t length,
protection_type prot)
noexcept(
false);
95 return reinterpret_cast<T *>(addr_);
98 fun.add_arg(info::function::argument(
_T(
"std::size_t length_"), length_));
107 return reinterpret_cast<T
const *>(addr_);
110 fun.add_arg(info::function::argument(
_T(
"std::size_t length_"), length_));
118 constexpr std::size_t length=
sizeof(T);
122 info::function::argument(
_T(
"std::size_t length"), length),
123 info::function::argument(
_T(
"sync_flags_t sync_flags"), sync_flags),
124 info::function::argument(
_T(
"void *addr_"), addr_)
128 if ((
reinterpret_cast<
std::uint8_t
const *>(addr)+length)>(
reinterpret_cast<
std::uint8_t
const *>(addr_)+length_)) {
131 info::function::argument(
_T(
"std::size_t length"), length),
132 info::function::argument(
_T(
"sync_flags_t sync_flags"), sync_flags),
133 info::function::argument(
_T(
"std::size_t length_"), length_),
134 info::function::argument(
_T(
"void *addr_"), addr_)
138 JMMCG_SYSCALL_WRAPPER(
"Unable sync the portion of the mapped memory.", _T(LIBJMMCG_VERSION_NUMBER), ::msync, addr, length, sync_flags);