1#ifndef __VSF_LINUX_FCNTL_H__
2#define __VSF_LINUX_FCNTL_H__
6#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
17#if VSF_LINUX_CFG_WRAPPER == ENABLED
18# define fcntl VSF_LINUX_WRAPPER(fcntl)
19# define creat VSF_LINUX_WRAPPER(creat)
20# define open VSF_LINUX_WRAPPER(open)
21# define openat VSF_LINUX_WRAPPER(openat)
28#define __NR_fcntl fcntl
29#define __NR_creat creat
31#define O_RDONLY 0x0000
32#define O_WRONLY 0x0001
34#define O_ACCMODE 0x0003
36#define O_NONBLOCK 0x0004
37#define O_APPEND 0x0008
38#define O_DIRECTORY 0x0100
42#define O_CLOEXEC 0x1000
45#define O_NOFOLLOW 0x8000
49#define O_NOCTTY 0x2000
50#define O_NDELAY O_NONBLOCK
52#define FNONBLOCK O_NONBLOCK
53#define FNDELAY O_NDELAY
54#define FAPPEND O_APPEND
60#define FNOCTTY O_NOCTTY
61#define FNOFOLLOW O_NOFOLLOW
62#define FCLOEXEC O_CLOEXEC
63#define FDIRECTORY O_DIRECTORY
66#define FLARGEFILE O_LARGEFILE
67#define FBINARY O_BINARY
89#define AT_SYMLINK_NOFOLLOW 0x100
93#define __FD_OPENBYLINK 31
105#if VSF_LINUX_APPLET_USE_FCNTL == ENABLED
117# ifndef __VSF_APPLET__
122#if defined(__VSF_APPLET__) && (defined(__VSF_APPLET_LIB__) || defined(__VSF_APPLET_LINUX_FCNTL_LIB__))\
123 && VSF_APPLET_CFG_ABI_PATCH != ENABLED && VSF_LINUX_APPLET_USE_FCNTL == ENABLED
125#ifndef VSF_LINUX_APPLET_FCNTL_VPLT
126# if VSF_LINUX_USE_APPLET == ENABLED
127# define VSF_LINUX_APPLET_FCNTL_VPLT \
128 ((vsf_linux_fcntl_vplt_t *)(VSF_LINUX_APPLET_VPLT->fcntl_vplt))
130# define VSF_LINUX_APPLET_FCNTL_VPLT \
131 ((vsf_linux_fcntl_vplt_t *)vsf_vplt((void *)0))
135#define VSF_LINUX_APPLET_FCNTL_ENTRY(__NAME) \
136 VSF_APPLET_VPLT_ENTRY_FUNC_ENTRY(VSF_LINUX_APPLET_FCNTL_VPLT, __NAME)
137#define VSF_LINUX_APPLET_FCNTL_IMP(...) \
138 VSF_APPLET_VPLT_ENTRY_FUNC_IMP(VSF_LINUX_APPLET_FCNTL_VPLT, __VA_ARGS__)
140VSF_LINUX_APPLET_FCNTL_IMP(
__fcntl_va,
int,
int fd,
int cmd, va_list ap) {
142 return VSF_LINUX_APPLET_FCNTL_ENTRY(
__fcntl_va)(fd, cmd, ap);
144VSF_LINUX_APPLET_FCNTL_IMP(
__open_va,
int,
const char *pathname,
int flags, va_list ap) {
146 return VSF_LINUX_APPLET_FCNTL_ENTRY(
__open_va)(pathname, flags, ap);
148VSF_LINUX_APPLET_FCNTL_IMP(
__openat_va,
int,
int dirfd,
const char *pathname,
int flags, va_list ap) {
150 return VSF_LINUX_APPLET_FCNTL_ENTRY(
__openat_va)(dirfd, pathname, flags, ap);
152VSF_LINUX_APPLET_FCNTL_IMP(
creat,
int,
const char *pathname,
mode_t mode) {
154 return VSF_LINUX_APPLET_FCNTL_ENTRY(
creat)(pathname, mode);
162 ret = ((int (*)(
int fd,
int cmd, va_list ap))VSF_LINUX_APPLET_FCNTL_ENTRY(
__fcntl_va))(fd, cmd, ap);
171 ret = ((int (*)(
const char *pathname,
int flags, va_list ap))VSF_LINUX_APPLET_FCNTL_ENTRY(
__open_va))(pathname, flags, ap);
180 ret = ((int (*)(
int dirfd,
const char *pathname,
int flags, va_list ap))VSF_LINUX_APPLET_FCNTL_ENTRY(
__openat_va))(dirfd, pathname, flags, ap);
188int fcntl(
int fd,
int cmd, ...);
190int __open_va(
const char *pathname,
int flags, va_list ap);
191int open(
const char *pathname,
int flags, ...);
192int __openat_va(
int dirfd,
const char *pathname,
int flags, va_list ap);
193int openat(
int dirfd,
const char *pathname,
int flags, ...);
#define creat
Definition fcntl.h:19
int __openat_va(int dirfd, const char *pathname, int flags, va_list ap)
Definition vsf_linux_fs.c:1855
int __open_va(const char *pathname, int flags, va_list ap)
Definition vsf_linux_fs.c:1838
#define openat
Definition fcntl.h:21
#define open
Definition fcntl.h:20
__VSF_VPLT_DECORATOR__ vsf_linux_fcntl_vplt_t vsf_linux_fcntl_vplt
Definition vsf_linux_fs.c:3609
#define fcntl
Definition fcntl.h:18
int __fcntl_va(int fd, int cmd, va_list ap)
Definition vsf_linux_fs.c:1892
int pid_t
Definition types.h:85
unsigned int mode_t
Definition types.h:87
long off_t
Definition types.h:95
short l_type
Definition fcntl.h:101
pid_t l_pid
Definition fcntl.h:100
off_t l_start
Definition fcntl.h:98
short l_whence
Definition fcntl.h:102
off_t l_len
Definition fcntl.h:99
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(creat)
vsf_vplt_info_t info
Definition fcntl.h:107
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(open)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__fcntl_va)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__open_va)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(__openat_va)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(openat)
VSF_APPLET_VPLT_ENTRY_FUNC_DEF(fcntl)
#define __VSF_VPLT_DECORATOR__
Definition vsf_cfg.h:93
#define VSF_APPLET_VPLT_ENTRY_FUNC_TRACE()
Definition vsf_cfg.h:165
#define VSF_APPLET_VPLT_FUNC_DECORATOR(__NAME)
Definition vsf_linux_applet_lib.c:1