blob: d3475f6b8e57013879c8a1de93dc8a95d195432b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#include "asm/unistd_64.h" // for __NR_openat
#include <fcntl.h> // for O_CREAT, openat
#include <stdarg.h> // for va_arg, va_end, va_list, va_start
#include <sys/types.h> // for mode_t
#include <syscall.h> // for __syscall_4, syscall
int openat(int fd, const char *path, int oflag, ...)
{
mode_t mode = 0;
if (oflag & O_CREAT) {
va_list ap;
va_start(ap, oflag);
mode = va_arg(ap, mode_t);
va_end(ap);
}
return syscall(openat, fd, path, oflag, mode);
}
|