tst_fd: Use raw syscall for fanotify_init
PATCH 1/1 tst_fd: Use raw syscall for fanotify_init
Some systems do not provide sys/fanotify.h, such as Android. We can use the raw syscall for open_fanotify to avoid importing the header file.
Suggested-by Cyril Hrubis <[email protected]>
Signed-off-by Edward Liaw <[email protected]>
--- lib/tst_fd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/tst_fd.c +2 -2
@@ -10,9 +10,9 @@#include <sys/eventfd.h> #include <sys/signalfd.h> #include <sys/timerfd.h> -#include <sys/fanotify.h> #include <sys/inotify.h> #include <linux/perf_event.h> +#include <linux/fanotify.h> #include "tst_test.h" #include "tst_safe_macros.h"
@@ -146,7 +146,7 @@ static void open_pidfd(struct tst_fd *fd)static void open_fanotify (struct tst_fd *fd) { - fd->fd =fanotify_init (FAN_CLASS_NOTIF ,O_RDONLY ); + fd->fd =syscall (__NR_fanotify_init,FAN_CLASS_NOTIF ,O_RDONLY );if (fd->fd <0 ) {tst_res (TCONF |TERRNO ,"Skipping %s" ,tst_fd_desc (fd));
Signature · 5 lines
2.44.0.rc0.258.g7320e95886-goog -- Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 6 lines · Edward Liaw via ltp
Some systems do not provide
sys/fanotify.h, such as Android. We can use the raw syscall foropen_fanotifyto avoid importing the header file.Suggested-by Cyril Hrubis <[email protected]>Signed-off-by Edward Liaw <[email protected]>
Reviewed-by Li Wang <[email protected]>
Signature · 5 lines
Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
thanks, merged!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp