[LTP] [PATCH 1/1] fanotify.h: Include

Petr Vorel
2023-01-25T23:28:12Z

to add kernel types (__s32, __u32, ...).

This fixes build on various Buildroot toolchains:

In file included from fanotify.h:14,
from fanotify04.c:25:
../../../../include/lapi/fanotify.h:198:2: error: unknown type name ‘__s32’
198 | __s32 error;
| ^~~~~
../../../../include/lapi/fanotify.h:199:2: error: unknown type name ‘__u32’
199 | __u32 error_count;
| ^~~~~

NOTE: Historically we tried to minimize number of linux includes,
because it would often lead to broken builds. Headers got better over
time and LTP also dropped support for archaic kernels over time.
Therefore we can keep original kernel types here.

Fixes: 67069fc46a ("syscalls/fanotify22: Validate the generic error info")

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
testcases/kernel/syscalls/fanotify/fanotify.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index 51078103eb..da78788378 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify.h
+++ b/testcases/kernel/syscalls/fanotify/fanotify.h
@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#include <linux/types.h>
#include "lapi/fanotify.h"
#include "lapi/fcntl.h"

--
2.39.1