engines/filestat: add statx(2) syscall support
[fio.git] / oslib / statx.c
CommitLineData
95f31f7d
TK
1#ifndef CONFIG_HAVE_STATX
2#include "statx.h"
3
4#ifdef CONFIG_HAVE_STATX_SYSCALL
5#include <unistd.h>
6#include <sys/syscall.h>
7
8int statx(int dfd, const char *pathname, int flags, unsigned int mask,
9 struct statx *buffer)
10{
11 return syscall(__NR_statx, dfd, pathname, flags, mask, buffer);
12}
13#else
14#include <errno.h>
15
16int statx(int dfd, const char *pathname, int flags, unsigned int mask,
17 struct statx *buffer)
18{
19 errno = EINVAL;
20 return -1;
21}
22#endif
23#endif