| 349 | // ---- kernel context ------------------------------------------------------ |
| 350 | |
| 351 | extern "C" LMPFS_API int lmpfs_kernel_banner(lmpfs_handle_t h, char* out, |
| 352 | size_t out_size) { |
| 353 | clear_last_error(); |
| 354 | auto* H = check(h); if (!H) return -1; |
| 355 | if (!out || out_size == 0) { set_last_error("null/empty out"); return -1; } |
| 356 | try { |
| 357 | const auto& b = H->kernel().banner; |
| 358 | std::size_t n = std::min(b.size(), out_size - 1); |
| 359 | std::memcpy(out, b.data(), n); |
| 360 | out[n] = '\0'; |
| 361 | return static_cast<int>(n); |
| 362 | } catch (const std::exception& e) { |
| 363 | set_last_error_fmt_what(e); return -1; |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | extern "C" LMPFS_API uint64_t lmpfs_kernel_direct_map_base(lmpfs_handle_t h) { |
| 368 | auto* H = check(h); if (!H) return 0; |
no test coverage detected