test/statx: be safe and check if __NR_statx is there
Probably don't need this, but it's right before release and I'd hate
for a test to cause compilation failure.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/test/statx.c b/test/statx.c
index d354d19..66f333f 100644
--- a/test/statx.c
+++ b/test/statx.c
@@ -15,11 +15,20 @@
#include "liburing.h"
+#ifdef __NR_statx
static int do_statx(int dfd, const char *path, int flags, unsigned mask,
struct statx *statxbuf)
{
return syscall(__NR_statx, dfd, path, flags, mask, statxbuf);
}
+#else
+static int do_statx(int dfd, const char *path, int flags, unsigned mask,
+ struct statx *statxbuf)
+{
+ errno = ENOSYS;
+ return -1;
+}
+#endif
static int create_file(const char *file, size_t size)
{