1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// This file is part of file-descriptors. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/file-descriptors/master/COPYRIGHT. No part of file-descriptors, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2018-2019 The developers of file-descriptors. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/file-descriptors/master/COPYRIGHT.
extern "C"
/// This value allows the receipt of events notifying that a file has been accessed and events for permission decisions if a file may be accessed.
/// It is intended for event listeners that need to access files before they contain their final data.
/// This notification class might be used by hierarchical storage managers, for example.
pub const FAN_CLASS_PRE_CONTENT: c_uint = 0x08;
/// This value allows the receipt of events notifying that a file has been accessed and events for permission decisions if a file may be accessed.
/// It is intended for event listeners that need to access files when they already contain their final content.
/// This notification class might be used by malware detection programs, for example.
pub const FAN_CLASS_CONTENT: c_uint = 0x04;
/// This is the default value.
/// It does not need to be specified.
/// This value only allows the receipt of events notifying that a file has been accessed.
/// Permission decisions before the file is accessed are not possible.
pub const FAN_CLASS_NOTIF: c_uint = 0x00;
/// This is the values `FAN_CLASS_PRE_CONTENT`, `FAN_CLASS_CONTENT` and `FAN_CLASS_NOTIF`.
pub const FAN_ALL_CLASS_BITS: c_uint = FAN_CLASS_PRE_CONTENT | FAN_CLASS_CONTENT | FAN_CLASS_NOTIF;
/// Set the close-on-exec flag (`FD_CLOEXEC`) on the new file descriptor.
pub const FAN_CLOEXEC: c_uint = 0x01;
/// Enable the nonblocking flag (`O_NONBLOCK`) for the file descriptor.
pub const FAN_NONBLOCK: c_uint = 0x02;
/// Remove the limit of `16384` events for the event queue.
/// Use of this flag requires the `CAP_SYS_ADMIN` capability.
pub const FAN_UNLIMITED_QUEUE: c_uint = 0x10;
/// Remove the limit of `8192` marks.
/// Use of this flag requires the `CAP_SYS_ADMIN` capability.
pub const FAN_UNLIMITED_MARKS: c_uint = 0x20;
/// This is the values `FAN_CLOEXEC`, `FAN_NONBLOCK`, `FAN_ALL_CLASS_BITS`, `FAN_UNLIMITED_QUEUE` and `FAN_UNLIMITED_MARKS`.
pub const FAN_ALL_INIT_FLAGS: c_uint = FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS;