From 61ba39a23786a7ae9694705af1d146c00a319144 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 5 Feb 2011 04:35:27 +0100 Subject: Getting rid of newlib, starting to implement a libc. Highly experimental, highly untested. --- libc/src/open.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libc/src/open.c (limited to 'libc/src/open.c') 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 +#include + +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; +} -- cgit v1.2.3