mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
Kernel: Implement multi-watch InodeWatcher :^)
This patch modifies InodeWatcher to switch to a one watcher, multiple watches architecture. The following changes have been made: - The watch_file syscall is removed, and in its place the create_iwatcher, iwatcher_add_watch and iwatcher_remove_watch calls have been added. - InodeWatcher now holds multiple WatchDescriptions for each file that is being watched. - The InodeWatcher file descriptor can be read from to receive events on all watched files. Co-authored-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
parent
2de11b0dc8
commit
fe5ca6ca27
16 changed files with 521 additions and 262 deletions
|
@ -27,154 +27,156 @@ typedef u32 socklen_t;
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
#define ENUMERATE_SYSCALLS(S) \
|
||||
S(yield) \
|
||||
S(open) \
|
||||
S(close) \
|
||||
S(read) \
|
||||
S(lseek) \
|
||||
S(kill) \
|
||||
S(getuid) \
|
||||
S(exit) \
|
||||
S(geteuid) \
|
||||
S(getegid) \
|
||||
S(getgid) \
|
||||
S(getpid) \
|
||||
S(getppid) \
|
||||
S(getresuid) \
|
||||
S(getresgid) \
|
||||
S(waitid) \
|
||||
S(mmap) \
|
||||
S(munmap) \
|
||||
S(get_dir_entries) \
|
||||
S(getcwd) \
|
||||
S(gettimeofday) \
|
||||
S(gethostname) \
|
||||
S(sethostname) \
|
||||
S(chdir) \
|
||||
S(uname) \
|
||||
S(set_mmap_name) \
|
||||
S(readlink) \
|
||||
S(write) \
|
||||
S(ttyname) \
|
||||
S(stat) \
|
||||
S(getsid) \
|
||||
S(setsid) \
|
||||
S(getpgid) \
|
||||
S(setpgid) \
|
||||
S(getpgrp) \
|
||||
S(fork) \
|
||||
S(execve) \
|
||||
S(dup2) \
|
||||
S(sigaction) \
|
||||
S(umask) \
|
||||
S(getgroups) \
|
||||
S(setgroups) \
|
||||
S(sigreturn) \
|
||||
S(sigprocmask) \
|
||||
S(sigpending) \
|
||||
S(pipe) \
|
||||
S(killpg) \
|
||||
S(seteuid) \
|
||||
S(setegid) \
|
||||
S(setuid) \
|
||||
S(setgid) \
|
||||
S(setreuid) \
|
||||
S(setresuid) \
|
||||
S(setresgid) \
|
||||
S(alarm) \
|
||||
S(fstat) \
|
||||
S(access) \
|
||||
S(fcntl) \
|
||||
S(ioctl) \
|
||||
S(mkdir) \
|
||||
S(times) \
|
||||
S(utime) \
|
||||
S(sync) \
|
||||
S(ptsname) \
|
||||
S(select) \
|
||||
S(unlink) \
|
||||
S(poll) \
|
||||
S(rmdir) \
|
||||
S(chmod) \
|
||||
S(socket) \
|
||||
S(bind) \
|
||||
S(accept) \
|
||||
S(listen) \
|
||||
S(connect) \
|
||||
S(link) \
|
||||
S(chown) \
|
||||
S(fchmod) \
|
||||
S(symlink) \
|
||||
S(sendmsg) \
|
||||
S(recvmsg) \
|
||||
S(getsockopt) \
|
||||
S(setsockopt) \
|
||||
S(create_thread) \
|
||||
S(gettid) \
|
||||
S(donate) \
|
||||
S(rename) \
|
||||
S(ftruncate) \
|
||||
S(exit_thread) \
|
||||
S(mknod) \
|
||||
S(writev) \
|
||||
S(beep) \
|
||||
S(getsockname) \
|
||||
S(getpeername) \
|
||||
S(socketpair) \
|
||||
S(sched_setparam) \
|
||||
S(sched_getparam) \
|
||||
S(fchown) \
|
||||
S(halt) \
|
||||
S(reboot) \
|
||||
S(mount) \
|
||||
S(umount) \
|
||||
S(dump_backtrace) \
|
||||
S(dbgputch) \
|
||||
S(dbgputstr) \
|
||||
S(watch_file) \
|
||||
S(mprotect) \
|
||||
S(realpath) \
|
||||
S(get_process_name) \
|
||||
S(fchdir) \
|
||||
S(getrandom) \
|
||||
S(getkeymap) \
|
||||
S(setkeymap) \
|
||||
S(clock_gettime) \
|
||||
S(clock_settime) \
|
||||
S(clock_nanosleep) \
|
||||
S(join_thread) \
|
||||
S(module_load) \
|
||||
S(module_unload) \
|
||||
S(detach_thread) \
|
||||
S(set_thread_name) \
|
||||
S(get_thread_name) \
|
||||
S(madvise) \
|
||||
S(purge) \
|
||||
S(profiling_enable) \
|
||||
S(profiling_disable) \
|
||||
S(profiling_free_buffer) \
|
||||
S(futex) \
|
||||
S(chroot) \
|
||||
S(pledge) \
|
||||
S(unveil) \
|
||||
S(perf_event) \
|
||||
S(shutdown) \
|
||||
S(get_stack_bounds) \
|
||||
S(ptrace) \
|
||||
S(sendfd) \
|
||||
S(recvfd) \
|
||||
S(sysconf) \
|
||||
S(set_process_name) \
|
||||
S(disown) \
|
||||
S(adjtime) \
|
||||
S(allocate_tls) \
|
||||
S(prctl) \
|
||||
S(mremap) \
|
||||
S(set_coredump_metadata) \
|
||||
S(anon_create) \
|
||||
S(msyscall) \
|
||||
S(readv) \
|
||||
#define ENUMERATE_SYSCALLS(S) \
|
||||
S(yield) \
|
||||
S(open) \
|
||||
S(close) \
|
||||
S(read) \
|
||||
S(lseek) \
|
||||
S(kill) \
|
||||
S(getuid) \
|
||||
S(exit) \
|
||||
S(geteuid) \
|
||||
S(getegid) \
|
||||
S(getgid) \
|
||||
S(getpid) \
|
||||
S(getppid) \
|
||||
S(getresuid) \
|
||||
S(getresgid) \
|
||||
S(waitid) \
|
||||
S(mmap) \
|
||||
S(munmap) \
|
||||
S(get_dir_entries) \
|
||||
S(getcwd) \
|
||||
S(gettimeofday) \
|
||||
S(gethostname) \
|
||||
S(sethostname) \
|
||||
S(chdir) \
|
||||
S(uname) \
|
||||
S(set_mmap_name) \
|
||||
S(readlink) \
|
||||
S(write) \
|
||||
S(ttyname) \
|
||||
S(stat) \
|
||||
S(getsid) \
|
||||
S(setsid) \
|
||||
S(getpgid) \
|
||||
S(setpgid) \
|
||||
S(getpgrp) \
|
||||
S(fork) \
|
||||
S(execve) \
|
||||
S(dup2) \
|
||||
S(sigaction) \
|
||||
S(umask) \
|
||||
S(getgroups) \
|
||||
S(setgroups) \
|
||||
S(sigreturn) \
|
||||
S(sigprocmask) \
|
||||
S(sigpending) \
|
||||
S(pipe) \
|
||||
S(killpg) \
|
||||
S(seteuid) \
|
||||
S(setegid) \
|
||||
S(setuid) \
|
||||
S(setgid) \
|
||||
S(setreuid) \
|
||||
S(setresuid) \
|
||||
S(setresgid) \
|
||||
S(alarm) \
|
||||
S(fstat) \
|
||||
S(access) \
|
||||
S(fcntl) \
|
||||
S(ioctl) \
|
||||
S(mkdir) \
|
||||
S(times) \
|
||||
S(utime) \
|
||||
S(sync) \
|
||||
S(ptsname) \
|
||||
S(select) \
|
||||
S(unlink) \
|
||||
S(poll) \
|
||||
S(rmdir) \
|
||||
S(chmod) \
|
||||
S(socket) \
|
||||
S(bind) \
|
||||
S(accept) \
|
||||
S(listen) \
|
||||
S(connect) \
|
||||
S(link) \
|
||||
S(chown) \
|
||||
S(fchmod) \
|
||||
S(symlink) \
|
||||
S(sendmsg) \
|
||||
S(recvmsg) \
|
||||
S(getsockopt) \
|
||||
S(setsockopt) \
|
||||
S(create_thread) \
|
||||
S(gettid) \
|
||||
S(donate) \
|
||||
S(rename) \
|
||||
S(ftruncate) \
|
||||
S(exit_thread) \
|
||||
S(mknod) \
|
||||
S(writev) \
|
||||
S(beep) \
|
||||
S(getsockname) \
|
||||
S(getpeername) \
|
||||
S(socketpair) \
|
||||
S(sched_setparam) \
|
||||
S(sched_getparam) \
|
||||
S(fchown) \
|
||||
S(halt) \
|
||||
S(reboot) \
|
||||
S(mount) \
|
||||
S(umount) \
|
||||
S(dump_backtrace) \
|
||||
S(dbgputch) \
|
||||
S(dbgputstr) \
|
||||
S(create_inode_watcher) \
|
||||
S(inode_watcher_add_watch) \
|
||||
S(inode_watcher_remove_watch) \
|
||||
S(mprotect) \
|
||||
S(realpath) \
|
||||
S(get_process_name) \
|
||||
S(fchdir) \
|
||||
S(getrandom) \
|
||||
S(getkeymap) \
|
||||
S(setkeymap) \
|
||||
S(clock_gettime) \
|
||||
S(clock_settime) \
|
||||
S(clock_nanosleep) \
|
||||
S(join_thread) \
|
||||
S(module_load) \
|
||||
S(module_unload) \
|
||||
S(detach_thread) \
|
||||
S(set_thread_name) \
|
||||
S(get_thread_name) \
|
||||
S(madvise) \
|
||||
S(purge) \
|
||||
S(profiling_enable) \
|
||||
S(profiling_disable) \
|
||||
S(profiling_free_buffer) \
|
||||
S(futex) \
|
||||
S(chroot) \
|
||||
S(pledge) \
|
||||
S(unveil) \
|
||||
S(perf_event) \
|
||||
S(shutdown) \
|
||||
S(get_stack_bounds) \
|
||||
S(ptrace) \
|
||||
S(sendfd) \
|
||||
S(recvfd) \
|
||||
S(sysconf) \
|
||||
S(set_process_name) \
|
||||
S(disown) \
|
||||
S(adjtime) \
|
||||
S(allocate_tls) \
|
||||
S(prctl) \
|
||||
S(mremap) \
|
||||
S(set_coredump_metadata) \
|
||||
S(anon_create) \
|
||||
S(msyscall) \
|
||||
S(readv) \
|
||||
S(emuctl)
|
||||
|
||||
namespace Syscall {
|
||||
|
@ -442,6 +444,12 @@ struct SC_set_coredump_metadata_params {
|
|||
StringArgument value;
|
||||
};
|
||||
|
||||
struct SC_inode_watcher_add_watch_params {
|
||||
int fd;
|
||||
StringArgument user_path;
|
||||
u32 event_mask;
|
||||
};
|
||||
|
||||
void initialize();
|
||||
int sync();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue