Kernel: Add a mechanism for listening for changes to an inode.

The syscall is quite simple:

    int watch_file(const char* path, int path_length);

It returns a file descriptor referring to a "InodeWatcher" object in the
kernel. It becomes readable whenever something changes about the inode.

Currently this is implemented by hooking the "metadata dirty bit" in
Inode which isn't perfect, but it's a start. :^)
This commit is contained in:
Andreas Kling 2019-07-22 20:01:11 +02:00
commit c8e2bb5605
Notes: sideshowbarker 2024-07-19 13:05:27 +09:00
12 changed files with 200 additions and 3 deletions

View file

@ -54,6 +54,7 @@ __BEGIN_DECLS
#define S_IRWXO (S_IRWXG >> 3)
int fcntl(int fd, int cmd, ...);
int watch_file(const char* path, int path_length);
#define F_RDLCK 0
#define F_WRLCK 1