#include #define MODIFICATION 1 // file written to #define DELETION 2 // file monitored is deleted #define ATTRIB_CHANGE 4 // attributes of file change struct watch { struct in_addr ipaddress; // remote ip int port; //remote port char *pathname; //file to be watched }; typedef struct watch watch_t; // file change handler will be called // when an event happens // with parameters: watch details and the // event that occurred on that watch typedef void (*filechangehandler_t)(watch_t, int); // takes a list of watches and a bitwise OR // of the events to watch (the events can be MODIFICATION, // DELETION, and/or ATTRIB_CHANGE). It also takes the callback // function which will be called when the watched file changes // returns a process scoped unique id for the watch or -1 on error // On error no watch will be started and parameter watches will point to // the watch that caused the error int register_distributed_watch(watch_t** watches, int no_of_watches, int events_mask, filechangehandler_t filechangehandler); // removes a distributed watch by watchid // returns 0 if ok, -1 on error int distributed_unwatch(int watchid);