@@ -45,6 +45,7 @@ inline constexpr int32_t errno_etimedout = ETIMEDOUT;
4545inline constexpr int32_t errno_eshutdown = ESHUTDOWN;
4646inline constexpr int32_t errno_ecanceled = ECANCELED;
4747inline constexpr int32_t errno_erange = ERANGE;
48+ inline constexpr int32_t errno_enoent = ENOENT;
4849
4950using descriptor = uint64_t ;
5051inline constexpr k2::descriptor INVALID_PLATFORM_DESCRIPTOR = 0 ;
@@ -176,6 +177,13 @@ inline auto readdir(k2::descriptor descriptor) noexcept {
176177 : return_type{std::nullopt };
177178}
178179
180+ inline std::expected<void , int32_t > access (std::string_view path, int32_t mode) noexcept {
181+ if (auto error_code{k2_access (path.data (), path.size (), mode)}; error_code != k2::errno_ok) [[unlikely]] {
182+ return std::unexpected{error_code};
183+ }
184+ return {};
185+ }
186+
179187inline std::expected<void , int32_t > unlink (std::string_view path) noexcept {
180188 if (auto error_code{k2_unlink (path.data (), path.size ())}; error_code != k2::errno_ok) [[unlikely]] {
181189 return std::unexpected{error_code};
@@ -184,8 +192,8 @@ inline std::expected<void, int32_t> unlink(std::string_view path) noexcept {
184192 }
185193}
186194
187- inline int32_t access (std::string_view component_name) noexcept {
188- return k2_access (component_name.size (), component_name.data ());
195+ inline int32_t component_access (std::string_view component_name) noexcept {
196+ return k2_component_access (component_name.size (), component_name.data ());
189197}
190198
191199inline void stream_status (k2::descriptor descriptor, StreamStatus* status) noexcept {
0 commit comments