mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
Userland+LibCore: Update FileWatcher + its users for InodeWatcher 2.0
With the new InodeWatcher API, the old style of creating a watcher per inode will no longer work. Therefore the FileWatcher API has been updated to support multiple watches, and its users have also been refactored to the new style. At the moment, all operations done on a (Blocking)FileWatcher return Result objects, however, this may be changed in the future if it becomes too obnoxious. :^) Co-authored-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
parent
fe5ca6ca27
commit
2159f90e00
12 changed files with 403 additions and 140 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -42,7 +43,9 @@ int open(const char* path, int options, ...);
|
|||
int openat(int dirfd, const char* path, int options, ...);
|
||||
|
||||
int fcntl(int fd, int cmd, ...);
|
||||
int watch_file(const char* path, size_t path_length);
|
||||
int create_inode_watcher(unsigned flags);
|
||||
int inode_watcher_add_watch(int fd, const char* path, size_t path_length, unsigned event_mask);
|
||||
int inode_watcher_remove_watch(int fd, int wd);
|
||||
|
||||
#define F_RDLCK 0
|
||||
#define F_WRLCK 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue