#include #include #include #include #include extern "C" { int open(const char* path, int flags, ...) { va_list ap; va_start(ap, flags); mode_t mode = (mode_t)va_arg(ap, int); long rc = syscall(SYS_open, path, flags, mode); va_end(ap); __errno_return(rc, int); } }