19#include <boost/interprocess/exceptions.hpp>
25static_assert(
false,
"ipc::shm::bipc_ext is built around Linux SHM semantics: a POSIX SHM object is a tmpfs "
26 "file; ftruncate() merely sets its size, pages being committed (RAM taken) only once "
27 "first written; posix_fallocate() commits them all up-front. Whether and how any of that "
28 "holds elsewhere (macOS/ARM64 et al) is untested and will need thoughtful design when "
40 using bipc::interprocess_exception;
41 using bipc::error_info;
42 using bipc::system_error_code;
54 rc = ftruncate(get_mapping_handle().handle, length);
56 while ((rc == -1) && (errno == EINTR));
60 throw interprocess_exception{error_info{system_error_code()}};
66 using ::posix_fallocate;
67 using bipc::interprocess_exception;
68 using bipc::error_info;
69 using bipc::system_error_code;
75 bipc::offset_t length;
76 if (!get_size(length))
78 throw interprocess_exception{error_info{system_error_code()}};
85 err = posix_fallocate(get_mapping_handle().handle, 0, length);
91 throw interprocess_exception{error_info{err}};
void truncate(bipc::offset_t length)
Hides Base::truncate(), which is not virtual; performs the truncate op; does not perform commit op.
void commit()
Commit (take RAM for) every page of the SHM-object's size as determined by the last truncate().
Extensions, informal or otherwise, of boost.ipc (boost::interprocess, bipc) SHM-related facilities,...