@@ -15,6 +15,8 @@ module core.sys.freebsd.sys.event;
15
15
16
16
version (FreeBSD ):
17
17
extern (C ):
18
+ nothrow :
19
+ @nogc :
18
20
19
21
import core.stdc.stdint ; // intptr_t, uintptr_t
20
22
import core.sys.posix.time ; // timespec
28
30
EVFILT_PROC = - 5 , /* attached to struct proc */
29
31
EVFILT_SIGNAL = - 6 , /* attached to struct proc */
30
32
EVFILT_TIMER = - 7 , /* timers */
31
- // EVFILT_NETDEV = -8, /* no longer supported */
33
+ EVFILT_PROCDESC = - 8 , /* attached to process descriptors */
32
34
EVFILT_FS = - 9 , /* filesystem events */
33
35
EVFILT_LIO = - 10 , /* attached to lio requests */
34
36
EVFILT_USER = - 11 , /* User events */
37
+ EVFILT_SENDFILE = - 12 , /* attached to sendfile requests */
35
38
EVFILT_SYSCOUNT = 11 ,
36
39
}
37
40
@@ -53,23 +56,26 @@ struct kevent_t
53
56
enum
54
57
{
55
58
/* actions */
56
- EV_ADD = 0x0001 , /* add event to kq (implies enable) */
57
- EV_DELETE = 0x0002 , /* delete event from kq */
58
- EV_ENABLE = 0x0004 , /* enable event */
59
- EV_DISABLE = 0x0008 , /* disable event (not reported) */
59
+ EV_ADD = 0x0001 , /* add event to kq (implies enable) */
60
+ EV_DELETE = 0x0002 , /* delete event from kq */
61
+ EV_ENABLE = 0x0004 , /* enable event */
62
+ EV_DISABLE = 0x0008 , /* disable event (not reported) */
63
+ EV_FORCEONESHOT = 0x0100 , /* enable _ONESHOT and force trigger */
60
64
61
65
/* flags */
62
- EV_ONESHOT = 0x0010 , /* only report one occurrence */
63
- EV_CLEAR = 0x0020 , /* clear event state after reporting */
64
- EV_RECEIPT = 0x0040 , /* force EV_ERROR on success, data=0 */
65
- EV_DISPATCH = 0x0080 , /* disable event after reporting */
66
+ EV_ONESHOT = 0x0010 , /* only report one occurrence */
67
+ EV_CLEAR = 0x0020 , /* clear event state after reporting */
68
+ EV_RECEIPT = 0x0040 , /* force EV_ERROR on success, data=0 */
69
+ EV_DISPATCH = 0x0080 , /* disable event after reporting */
66
70
67
- EV_SYSFLAGS = 0xF000 , /* reserved by system */
68
- EV_FLAG1 = 0x2000 , /* filter-specific flag */
71
+ EV_SYSFLAGS = 0xF000 , /* reserved by system */
72
+ EV_DROP = 0x1000 , /* note should be dropped */
73
+ EV_FLAG1 = 0x2000 , /* filter-specific flag */
74
+ EV_FLAG2 = 0x4000 , /* filter-specific flag */
69
75
70
76
/* returned values */
71
- EV_EOF = 0x8000 , /* EOF detected */
72
- EV_ERROR = 0x4000 , /* error, data contains errno */
77
+ EV_EOF = 0x8000 , /* EOF detected */
78
+ EV_ERROR = 0x4000 , /* error, data contains errno */
73
79
}
74
80
75
81
enum
97
103
* data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
98
104
*/
99
105
NOTE_LOWAT = 0x0001 , /* low water mark */
106
+ NOTE_FILE_POLL = 0x0002 , /* behave like poll() */
100
107
101
108
/*
102
109
* data/hint flags for EVFILT_VNODE, shared with userspace
@@ -108,9 +115,15 @@ enum
108
115
NOTE_LINK = 0x0010 , /* link count changed */
109
116
NOTE_RENAME = 0x0020 , /* vnode was renamed */
110
117
NOTE_REVOKE = 0x0040 , /* vnode access was revoked */
118
+ NOTE_OPEN = 0x0080 , /* vnode was opened */
119
+ NOTE_CLOSE = 0x0100 , /* file closed, fd did not
120
+ allowed write */
121
+ NOTE_CLOSE_WRITE = 0x0200 , /* file closed, fd did allowed
122
+ write */
123
+ NOTE_READ = 0x0400 , /* file was read */
111
124
112
125
/*
113
- * data/hint flags for EVFILT_PROC, shared with userspace
126
+ * data/hint flags for EVFILT_PROC and EVFILT_PROCDESC , shared with userspace
114
127
*/
115
128
NOTE_EXIT = 0x80000000 , /* process exited */
116
129
NOTE_FORK = 0x40000000 , /* process forked */
@@ -122,6 +135,12 @@ enum
122
135
NOTE_TRACK = 0x00000001 , /* follow across forks */
123
136
NOTE_TRACKERR = 0x00000002 , /* could not track child */
124
137
NOTE_CHILD = 0x00000004 , /* am a child process */
138
+
139
+ /* additional flags for EVFILT_TIMER */
140
+ NOTE_SECONDS = 0x00000001 , /* data is seconds */
141
+ NOTE_MSECONDS = 0x00000002 , /* data is milliseconds */
142
+ NOTE_USECONDS = 0x00000004 , /* data is microseconds */
143
+ NOTE_NSECONDS = 0x00000008 , /* data is nanoseconds */
125
144
}
126
145
127
146
int kqueue ();
0 commit comments