summaryrefslogtreecommitdiff
path: root/libc/src/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/src/open.c')
-rw-r--r--libc/src/open.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libc/src/open.c b/libc/src/open.c
new file mode 100644
index 0000000..71a96d1
--- /dev/null
+++ b/libc/src/open.c
@@ -0,0 +1,17 @@
+#include "stdio.h"
+#include "reent.h"
+#include "errno.h"
+#include <fio.h>
+#include <filesystem.h>
+
+int open(const char * path, int flags) {
+ int r;
+
+ r = fs_open(path, flags, 0755);
+
+ if (r >= 0)
+ return r;
+
+ _impure_ptr->_errno = EACCES;
+ return -1;
+}