diff --git a/src/lib/fmt/SystemError.hxx b/src/lib/fmt/SystemError.hxx index 8ee2efe3b..a53e26ec2 100644 --- a/src/lib/fmt/SystemError.hxx +++ b/src/lib/fmt/SystemError.hxx @@ -67,6 +67,15 @@ FmtLastError(const S &format_str, Args&&... args) noexcept #endif // _WIN32 +[[nodiscard]] [[gnu::pure]] +inline std::system_error +VFmtErrno(int code, + fmt::string_view format_str, fmt::format_args args) noexcept +{ + return VFmtSystemError(std::error_code(code, ErrnoCategory()), + format_str, args); +} + template requires(std::is_convertible_v) [[nodiscard]] [[gnu::pure]]