2023-04-23 14:32:37 +03:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <errno.h>
|
2023-07-10 15:08:30 +03:00
|
|
|
#include <stdarg.h>
|
2023-04-23 14:32:37 +03:00
|
|
|
#include <sys/syscall.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
int open(const char* path, int oflag, ...)
|
|
|
|
{
|
2023-07-10 15:08:30 +03:00
|
|
|
va_list args;
|
|
|
|
va_start(args, oflag);
|
|
|
|
mode_t mode = va_arg(args, mode_t);
|
|
|
|
va_end(args);
|
|
|
|
|
|
|
|
return syscall(SYS_OPEN, path, oflag, mode);
|
2023-04-23 14:32:37 +03:00
|
|
|
}
|
2023-06-11 03:27:56 +03:00
|
|
|
|
|
|
|
int openat(int fd, const char* path, int oflag, ...)
|
|
|
|
{
|
2023-07-10 15:08:30 +03:00
|
|
|
va_list args;
|
|
|
|
va_start(args, oflag);
|
|
|
|
mode_t mode = va_arg(args, mode_t);
|
|
|
|
va_end(args);
|
|
|
|
|
|
|
|
return syscall(SYS_OPENAT, fd, path, oflag, mode);
|
2023-06-11 03:27:56 +03:00
|
|
|
}
|