From 6c8598ca45b8c0910fc0f45352b31711164e4d1c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 21 Mar 2010 09:55:10 +0100 Subject: Add inotify_init1() and inotify_add_watch() mask string support. * tapset/aux_syscalls.stp (_inotify_watch_mask_str): New helper function. (_inotify_init1_flag_str): Likewise. * tapset/syscalls.stp (inotify_add_watch): Stringify watch mask. (syscall.inotify_init[.return]): Add inotify_init1() support. * testsuite/systemtap.syscall/inotify.c: New test. --- testsuite/systemtap.syscall/inotify.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 testsuite/systemtap.syscall/inotify.c (limited to 'testsuite/systemtap.syscall/inotify.c') diff --git a/testsuite/systemtap.syscall/inotify.c b/testsuite/systemtap.syscall/inotify.c new file mode 100644 index 00000000..8f9c6a01 --- /dev/null +++ b/testsuite/systemtap.syscall/inotify.c @@ -0,0 +1,28 @@ +/* COVERAGE: inotify_init, inotify_init1, inotify_add_watch, inotify_rm_watch */ + +#include + +int main() +{ + int fd = inotify_init(); + //staptest// inotify_init () = NNNN + + int wd = inotify_add_watch(fd, "/tmp", IN_ALL_EVENTS); + //staptest// inotify_add_watch (NNNN, "/tmp", IN_ACCESS|IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_CLOSE_NOWRITE|IN_OPEN|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF) = NNNN + + inotify_rm_watch(fd, wd); + //staptest// inotify_rm_watch (NNNN, NNNN) = 0 + +#ifdef IN_CLOEXEC + inotify_init1(IN_NONBLOCK); + //staptest// inotify_init1 (IN_NONBLOCK) = NNNN + + inotify_init1(IN_CLOEXEC); + //staptest// inotify_init1 (IN_CLOEXEC) = NNNN + + inotify_init1(IN_NONBLOCK|IN_CLOEXEC); + //staptest// inotify_init1 (IN_NONBLOCK|IN_CLOEXEC) = NNNN +#endif + + return 0; +} -- cgit