From cfcd73ed4bc46f9824002911d371975390bba2a0 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 6 Feb 2024 23:27:40 -0600 Subject: [PATCH] fs_openat.hpp --- src/fs_openat.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/fs_openat.hpp b/src/fs_openat.hpp index dd87be72..e52caaaf 100644 --- a/src/fs_openat.hpp +++ b/src/fs_openat.hpp @@ -18,6 +18,8 @@ #pragma once +#include "ghc/filesystem.hpp" + #include #include #include @@ -53,4 +55,19 @@ namespace fs return ((rv == -1) ? -errno : rv); } + + static + inline + int + openat(const int dirfd_, + const char *pathname_, + const int flags_, + const mode_t mode_) + { + int rv; + + rv = ::openat(dirfd_,pathname_,flags_,mode_); + + return ((rv == -1) ? -errno : rv); + } }