9#ifndef INOTIFY_SYSCALLS_H
10#define INOTIFY_SYSCALLS_H
12#include "pedigree/kernel/compiler.h"
13#include "pedigree/kernel/process/Readiness.h"
14#include "pedigree/kernel/processor/types.h"
19namespace LinuxInotify {
20constexpr uint32_t Access = 0x00000001;
21constexpr uint32_t Modify = 0x00000002;
22constexpr uint32_t Attributes = 0x00000004;
23constexpr uint32_t CloseWrite = 0x00000008;
24constexpr uint32_t CloseNoWrite = 0x00000010;
25constexpr uint32_t Open = 0x00000020;
26constexpr uint32_t MovedFrom = 0x00000040;
27constexpr uint32_t MovedTo = 0x00000080;
28constexpr uint32_t Create = 0x00000100;
29constexpr uint32_t Delete = 0x00000200;
30constexpr uint32_t DeleteSelf = 0x00000400;
31constexpr uint32_t MoveSelf = 0x00000800;
32constexpr uint32_t AllEvents = 0x00000FFF;
33constexpr uint32_t Unmount = 0x00002000;
34constexpr uint32_t QueueOverflow = 0x00004000;
35constexpr uint32_t Ignored = 0x00008000;
36constexpr uint32_t OnlyDirectory = 0x01000000;
37constexpr uint32_t DontFollow = 0x02000000;
38constexpr uint32_t ExcludeUnlinked = 0x04000000;
39constexpr uint32_t MaskCreate = 0x10000000;
40constexpr uint32_t MaskAdd = 0x20000000;
41constexpr uint32_t IsDirectory = 0x40000000;
42constexpr uint32_t OneShot = 0x80000000;
43constexpr uint32_t AllBits = AllEvents | Unmount | QueueOverflow | Ignored | OnlyDirectory |
44 DontFollow | ExcludeUnlinked | MaskCreate | MaskAdd | IsDirectory |
47constexpr int NonBlock = 0x00000800;
48constexpr int CloseOnExec = 0x00080000;
58 "Linux x86-64 inotify_event header must be 16 bytes");
66 int addWatch(
File* target, uint32_t mask);
67 int removeWatch(
int wd);
68 int readEvents(uint8_t* buffer,
size_t length,
bool canBlock);
69 int readEventsToUser(uint8_t* buffer,
size_t length,
bool canBlock);
71 ReadyMask queryReady();
76 void lastDescriptorClosed();
82 void reapInactiveWatches();
87int posix_inotify_init();
88int posix_inotify_init1(
int flags);
89int posix_inotify_add_watch(
int fd,
const char* pathname, uint32_t mask);
90int posix_inotify_rm_watch(
int fd,
int wd);
virtual ReadinessGenerations readinessGenerations()