#include "defs.h"
#include <sys/param.h>
-#ifdef HAVE_POLL_H
+#if defined HAVE_POLL_H
# include <poll.h>
-#endif
-#ifdef HAVE_SYS_POLL_H
+#elif defined HAVE_SYS_POLL_H
# include <sys/poll.h>
#endif
/*
* Add a path to the set we're tracing.
- * Secifying NULL will delete all paths.
+ * Specifying NULL will delete all paths.
*/
static void
storepath(const char *path)
s = tcp->s_ent;
- if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC)))
+ if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC | TRACE_NETWORK)))
return 0;
/*
s->sys_func == sys_faccessat ||
s->sys_func == sys_fchmodat ||
s->sys_func == sys_futimesat ||
- s->sys_func == sys_mkdirat ||
s->sys_func == sys_unlinkat ||
s->sys_func == sys_newfstatat ||
s->sys_func == sys_mknodat ||
}
if (s->sys_func == sys_renameat ||
+ s->sys_func == sys_renameat2 ||
s->sys_func == sys_linkat)
{
/* fd, path, fd, path */
return fdmatch(tcp, tcp->u_arg[2]);
}
+ if (s->sys_func == sys_fanotify_mark) {
+ /* x, x, x, fd, path */
+ return fdmatch(tcp, tcp->u_arg[3]) ||
+ upathmatch(tcp, tcp->u_arg[4]);
+ }
+
if (s->sys_func == sys_select ||
s->sys_func == sys_oldselect ||
s->sys_func == sys_pselect6)
s->sys_func == sys_timerfd_settime ||
s->sys_func == sys_timerfd_gettime ||
s->sys_func == sys_epoll_create ||
- strcmp(s->sys_name, "fanotify_init") == 0)
+ s->sys_func == sys_socket ||
+ s->sys_func == sys_socketpair ||
+ s->sys_func == sys_fanotify_init)
{
/*
- * These have TRACE_FILE or TRACE_DESCRIPTOR set, but they
- * don't have any file descriptor or path args to test.
+ * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set,
+ * but they don't have any file descriptor or path args to test.
*/
return 0;
}
if (s->sys_flags & TRACE_FILE)
return upathmatch(tcp, tcp->u_arg[0]);
- if (s->sys_flags & TRACE_DESC)
+ if (s->sys_flags & (TRACE_DESC | TRACE_NETWORK))
return fdmatch(tcp, tcp->u_arg[0]);
return 0;