navicat-keygen-2023/common/resource_traits/unix_os/map_view.hpp
Double Sine 9017721a5c
upload codebase
Signed-off-by: Double Sine <xiao_ai_yu@live.cn>
2022-02-14 15:52:37 +08:00

20 lines
389 B
C++

#pragma once
#include <errno.h>
#include <unistd.h>
#include <sys/mman.h>
namespace nkg::resource_traits::unix_os {
struct map_view {
using handle_t = void*;
static inline const handle_t invalid_value = MAP_FAILED;
[[nodiscard]]
static bool is_valid(const handle_t& handle) noexcept {
return handle != invalid_value;
}
};
}