Luna/libs/libc/src/fcntl.cpp
apio 9e0bd39964 libc: Implement wrappers for sys_{open,read,write}
read() and close() are in unistd.h, but open() in fnctl.h.
I thought only the definitions for O_SOMETHING were in fnctl.h, but it is as it is.
Don't know why, but let's not anger the Unix gods.

The FILE* C API is pending as well.
2022-10-10 20:45:26 +02:00

11 lines
193 B
C++

#include <fcntl.h>
#include <sys/syscall.h>
#include <unistd.h>
extern "C"
{
int open(const char* pathname, int flags)
{
return (int)syscall(SYS_open, pathname, flags);
}
}