23#include <flow/log/log.hpp>
24#include <flow/async/util.hpp>
25#include <boost/asio.hpp>
26#include <boost/interprocess/permissions.hpp>
27#include <boost/interprocess/creation_tags.hpp>
55template <
typename T,
typename Allocator = std::allocator<T>>
56class Default_init_allocator;
58class Use_counted_object;
66static_assert(
false,
"Design of Permissions_level assumes a POSIX-y security model with users and groups; "
67 "we have not yet considered whether it can apply to Windows in its current form. "
68 "Should work in non-Linux POSIX OS (like macOS) but must be checked/tested.");
Flow-IPC module containing miscellaneous general-use facilities that ubiquitously used by ~all Flow-I...
::pid_t process_id_t
Syntactic-sugary type for POSIX process ID (integer).
bipc::permissions Permissions
Short-hand for Unix (POSIX) permissions class.
const uint8_t * blob_data(const Blob_const &blob)
Syntactic-sugary helper that returns pointer to first byte in an immutable buffer,...
Permissions_level
Simple specifier of desired access permissions, usually but not necessarily translated into a Permiss...
@ S_UNRESTRICTED
Allows access by all. Implies, as well, at least as much access as S_GROUP_ACCESS and thus S_USER_ACC...
@ S_USER_ACCESS
Allows access by resource-owning user (in POSIX/Unix identified by UID) and no one else.
@ S_GROUP_ACCESS
Allows access by resource-owning user's containing group(s) (in POSIX/Unix identified by GID) and no ...
@ S_NO_ACCESS
Forbids all access, even by the creator's user. Most likely this would be useful for testing or debug...
flow::async::Task Task
Short-hand for polymorphic function (a-la std::function<>) that takes no arguments and returns nothin...
bipc::open_only_t Open_only
Tag type indicating an ideally-atomic open-if-exists-else-fail operation.
::gid_t group_id_t
Syntactic-sugary type for POSIX group ID (integer).
const Open_or_create OPEN_OR_CREATE
Tag value indicating an open-if-exists-else-create operation.
::uid_t user_id_t
Syntactic-sugary type for POSIX user ID (integer).
const Open_only OPEN_ONLY
Tag value indicating an atomic open-if-exists-else-fail operation.
boost::asio::mutable_buffer Blob_mutable
Short-hand for an mutable blob somewhere in memory, stored as exactly a void* and a size_t.
bool process_running(process_id_t process_id)
Returns true if and only if the given process (by PID) is reported as running by the OS.
bipc::open_or_create_t Open_or_create
Tag type indicating an atomic open-if-exists-else-create operation.
bipc::create_only_t Create_only
Tag type indicating a create-unless-exists-else-fail operation.
flow::Fine_time_pt Fine_time_pt
Short-hand for Flow's Fine_time_pt.
void set_resource_permissions(flow::log::Logger *logger_ptr, const fs::path &path, const Permissions &perms, Error_code *err_code)
Utility that sets the permissions of the given resource (at the supplied file system path) to specifi...
Permissions shared_resource_permissions(Permissions_level permissions_lvl)
Maps general Permissions_level specifier to low-level Permissions value, when the underlying resource...
flow::Fine_duration Fine_duration
Short-hand for Flow's Fine_duration.
const std::string EMPTY_STRING
A (default-cted) string. May be useful for functions returning const std::string&.
const Create_only CREATE_ONLY
Tag value indicating an atomic create-unless-exists-else-fail operation.
boost::asio::const_buffer Blob_const
Short-hand for an immutable blob somewhere in memory, stored as exactly a void const * and a size_t.
flow::util::String_view String_view
Short-hand for Flow's String_view.
@ S_END_SENTINEL
CAUTION – see ipc::Log_component doc header for directions to find actual members of this enum class.
flow::Error_code Error_code
Short-hand for flow::Error_code which is very common.
A monolayer-thin wrapper around a native handle, a/k/a descriptor a/k/a FD.