[LTP] [PATCH 1/1] lib: tst_fd: Use tst_syscall() for TBROK

Petr Vorel pvorel@suse.cz
Wed Jan 24 15:21:08 CET 2024


to avoid error on older distro (kernel 4.12)

tst_fd.c:144: TBROK: pidfd_open(): ENOSYS (38)

Fixes: a2b945776 ("lib: tst_fd: Avoid tst_brk(TCONF, ...) on older distros")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/tst_fd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/tst_fd.c b/lib/tst_fd.c
index ab7de81aa..a21a41131 100644
--- a/lib/tst_fd.c
+++ b/lib/tst_fd.c
@@ -139,7 +139,7 @@ static void open_timerfd(struct tst_fd *fd)
 
 static void open_pidfd(struct tst_fd *fd)
 {
-	fd->fd = syscall(__NR_pidfd_open, getpid(), 0);
+	fd->fd = tst_syscall(__NR_pidfd_open, getpid(), 0);
 	if (fd->fd < 0)
 		tst_brk(TBROK | TERRNO, "pidfd_open()");
 }
-- 
2.43.0



More information about the ltp mailing list