25 #ifndef POLLFANOTIFY_H
26 #define POLLFANOTIFY_H
28 #include <sys/fanotify.h>
107 const void *buf,
int len);
109 static void *
run(
void *);
111 static void *
scanFile(
void *workitem);
Implements the thread pool pattern.
static int markMount(int fd, const char *mount)
Marks a mount for polling fanotify events.
static void * scanFile(void *workitem)
Scans a file.
void(* skyld_pollfanotifycallbackptr)(const int fd, const void *buf, int len)
pthread_t thread
Worker thread.
ThreadPool * tp
Thread pool for scanning tasks.
static int unmarkMount(int fd, const char *mount)
Removes a mount from polling fanotify events.
struct fanotify_event_metadata metadata
fanotify metadata
Implements the thread pool pattern.
~FanotifyPolling()
Stops polling fanotify events.
int fanotifyClose()
Closes fanotify file descriptor.
Polls mount and unmout events.
FanotifyPolling(Environment *)
Starts polling fanotify events.
Environment * e
Environment.
Poll /proc/mounts to detect mount events.
void handleFanotifyEvent(const struct fanotify_event_metadata *)
Handle fanotify events.
The environment holds variables that are shared by instances of multiple classes. ...
int exclude(const int fd)
Check if file is in exclude path.
void handleFanotifyEvents(const void *buf, int len)
Handle fanotify events.
MountPolling * mp
Mount polling object.
int writeResponse(const struct fanotify_response, int)
Writes fanotify response.
static void * run(void *)
Thread listening to fanotify events.
pthread_mutex_t mutex_response
Mutex for fanotify response.
int fd
Fanotify file descriptor.
FanotifyPolling * fp
fanotify polling object
enum Status status
Status of fanotify polling object.