summaryrefslogtreecommitdiff
path: root/libc/src/open.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2011-02-05 04:35:27 +0100
commit61ba39a23786a7ae9694705af1d146c00a319144 (patch)
treef9ad51bee751f7e878ac3e7ad4d45f993605c37d /libc/src/open.c
parente2d292afdb43cd7d9391128563384e1edd53c52e (diff)
Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested.
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;
+}