17inline void fill_dev_path(
char *data,
size_t size, uint32_t dev_id) {
19 auto res = std::format_to_n(data,
static_cast<std::ptrdiff_t
>(size - 1),
20 "/dev/ublkc{}", dev_id);
24inline std::string dev_path(uint32_t dev_id) {
25 return std::format(
"/dev/ublkc{}", dev_id);
28inline constexpr size_t DEV_PATH_LEN = 32;
30template <
typename T>
struct DevPathBuf {
31 static_assert(
alignof(T) <= DEV_PATH_LEN,
32 "payload alignment must not exceed DEV_PATH_LEN");
33 char path[DEV_PATH_LEN];
36 DevPathBuf(uint32_t dev_id) { fill_dev_path(path,
sizeof(path), dev_id); }
The main namespace of the ublk-cpp library.