Skip to contentSkip to conversation

syscalls/fanotify11: new test for report thread id

PATCH New Amir Goldstein 2 participants 2 messages Nov 28, 2018

v3 of 4 New Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 syscalls/fanotify11: new test for report thread id

From: nixiaoming <[email protected]>

Test fanotify_init with FAN_REPORT_TID -
Verify that event->pid is pid of the thread that caused the event

Test fanotify_init without FAN_REPORT_TID -
Verify that event->pid is tgid of the process that caused the event

---

Hi Cyril,

This is a test for yet another new fanotify API that was introduced in kernel v4.20-rc1.

The new API as well as this test were written by nixiaoming, but since I helped with review and final touches over v2 of the test, I promissed to post v3 when the time comes...

Thanks,
Amir.

 runtest/syscalls                              |   1 +
 testcases/kernel/syscalls/fanotify/.gitignore |   1 +
 testcases/kernel/syscalls/fanotify/Makefile   |   2 +-
 testcases/kernel/syscalls/fanotify/fanotify.h |   4 +
 .../kernel/syscalls/fanotify/fanotify11.c     | 109 ++++++++++++++++++
 5 files changed, 116 insertions(+), 1 deletion(-)
 create mode 100644 testcases/kernel/syscalls/fanotify/fanotify11.c
runtest/syscalls +1 -0
index 61865f8e0..ac1d2d2cd 100644
@@ -508,6 +508,7 @@ fanotify07 fanotify07
 fanotify08 fanotify08
 fanotify09 fanotify09
 fanotify10 fanotify10
+fanotify11 fanotify11
 
 ioperm01 ioperm01
 ioperm02 ioperm02
testcases/kernel/syscalls/fanotify/.gitignore +1 -0
index c26f2bd27..3818e241f 100644
@@ -8,3 +8,4 @@
 /fanotify08
 /fanotify09
 /fanotify10
+/fanotify11
testcases/kernel/syscalls/fanotify/Makefile +1 -1
index bb58878d7..5d01b4825 100644
@@ -17,7 +17,7 @@
 #
 
 top_srcdir		?= ../../../..
-
+fanotify11: CFLAGS+=-pthread
 include $(top_srcdir)/include/mk/testcases.mk
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/fanotify/fanotify.h +4 -0
index 535f1cef2..880dea534 100644
@@ -54,6 +54,10 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,
 
 #endif /* HAVE_SYS_FANOTIFY_H */
 
+#ifndef FAN_REPORT_TID
+#define FAN_REPORT_TID		0x00000100
+#endif
+
 #ifndef FAN_MARK_INODE
 #define FAN_MARK_INODE		0
 #endif
testcases/kernel/syscalls/fanotify/fanotify11.c new file +109 -0

109 lines not on this page · raw message

Signature · 1 line
2.17.1