aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.posix/posix.open.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-06-29 19:19:23 +0100
committerLexi Winter <lexi@le-fay.org>2025-06-29 19:19:23 +0100
commita8b0ea58e60bb0326b7f7c8f3c736d89ce9ef1df (patch)
tree6dafcf2674780649dcdc2649855722357837a68e /nihil.posix/posix.open.cc
parent4fa6821e0645ff61a9380cd090abff472205c630 (diff)
downloadnihil-a8b0ea58e60bb0326b7f7c8f3c736d89ce9ef1df.tar.gz
nihil-a8b0ea58e60bb0326b7f7c8f3c736d89ce9ef1df.tar.bz2
wip macOS port
Diffstat (limited to 'nihil.posix/posix.open.cc')
-rw-r--r--nihil.posix/posix.open.cc31
1 files changed, 0 insertions, 31 deletions
diff --git a/nihil.posix/posix.open.cc b/nihil.posix/posix.open.cc
deleted file mode 100644
index 9ef6538..0000000
--- a/nihil.posix/posix.open.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This source code is released into the public domain.
- */
-
-module;
-
-#include <expected>
-#include <filesystem>
-#include <system_error>
-
-#include <fcntl.h>
-#include <unistd.h>
-
-module nihil.posix;
-
-import nihil.error;
-import :fd;
-
-namespace nihil {
-
-auto open(std::filesystem::path const &filename, int flags, int mode)
- -> std::expected<fd, error>
-{
- auto fdno = ::open(filename.c_str(), flags, mode);
- if (fdno != -1)
- return fd(fdno);
-
- return std::unexpected(error(std::errc(errno)));
-}
-
-} // namespace nihil