#include #include #include #include extern "C" { int open(const char* pathname, int flags) { return (int)syscall(SYS_open, pathname, flags); } int fcntl(int fd, int cmd, ...) { va_list ap; va_start(ap, cmd); long result; switch (cmd) { case F_DUPFD: result = syscall(SYS_fcntl, fd, cmd, va_arg(ap, int)); break; default: result = syscall(SYS_fcntl, fd, cmd, 0); break; } va_end(ap); return (int)result; } }