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.
11 lines
193 B
C++
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);
|
|
}
|
|
} |