Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit af5fe9f

Browse files
author
Moritz Maxeiner
committed
Update core.sys.freebsd.sys.event to FreeBSD 11.0
1 parent 378615b commit af5fe9f

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

src/core/sys/freebsd/sys/event.d

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ enum
2828
EVFILT_PROC = -5, /* attached to struct proc */
2929
EVFILT_SIGNAL = -6, /* attached to struct proc */
3030
EVFILT_TIMER = -7, /* timers */
31-
// EVFILT_NETDEV = -8, /* no longer supported */
31+
EVFILT_PROCDESC = -8, /* attached to process descriptors */
3232
EVFILT_FS = -9, /* filesystem events */
3333
EVFILT_LIO = -10, /* attached to lio requests */
3434
EVFILT_USER = -11, /* User events */
35+
EVFILT_SENDFILE = -12, /* attached to sendfile requests */
3536
EVFILT_SYSCOUNT = 11,
3637
}
3738

@@ -53,23 +54,26 @@ struct kevent_t
5354
enum
5455
{
5556
/* 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) */
57+
EV_ADD = 0x0001, /* add event to kq (implies enable) */
58+
EV_DELETE = 0x0002, /* delete event from kq */
59+
EV_ENABLE = 0x0004, /* enable event */
60+
EV_DISABLE = 0x0008, /* disable event (not reported) */
61+
EV_FORCEONESHOT = 0x0100, /* enable _ONESHOT and force trigger */
6062

6163
/* 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 */
64+
EV_ONESHOT = 0x0010, /* only report one occurrence */
65+
EV_CLEAR = 0x0020, /* clear event state after reporting */
66+
EV_RECEIPT = 0x0040, /* force EV_ERROR on success, data=0 */
67+
EV_DISPATCH = 0x0080, /* disable event after reporting */
6668

67-
EV_SYSFLAGS = 0xF000, /* reserved by system */
68-
EV_FLAG1 = 0x2000, /* filter-specific flag */
69+
EV_SYSFLAGS = 0xF000, /* reserved by system */
70+
EV_DROP = 0x1000, /* note should be dropped */
71+
EV_FLAG1 = 0x2000, /* filter-specific flag */
72+
EV_FLAG2 = 0x4000, /* filter-specific flag */
6973

7074
/* returned values */
71-
EV_EOF = 0x8000, /* EOF detected */
72-
EV_ERROR = 0x4000, /* error, data contains errno */
75+
EV_EOF = 0x8000, /* EOF detected */
76+
EV_ERROR = 0x4000, /* error, data contains errno */
7377
}
7478

7579
enum
@@ -97,6 +101,7 @@ enum
97101
* data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
98102
*/
99103
NOTE_LOWAT = 0x0001, /* low water mark */
104+
NOTE_FILE_POLL = 0x0002, /* behave like poll() */
100105

101106
/*
102107
* data/hint flags for EVFILT_VNODE, shared with userspace
@@ -108,9 +113,15 @@ enum
108113
NOTE_LINK = 0x0010, /* link count changed */
109114
NOTE_RENAME = 0x0020, /* vnode was renamed */
110115
NOTE_REVOKE = 0x0040, /* vnode access was revoked */
116+
NOTE_OPEN = 0x0080, /* vnode was opened */
117+
NOTE_CLOSE = 0x0100, /* file closed, fd did not
118+
allowed write */
119+
NOTE_CLOSE_WRITE = 0x0200, /* file closed, fd did allowed
120+
write */
121+
NOTE_READ = 0x0400, /* file was read */
111122

112123
/*
113-
* data/hint flags for EVFILT_PROC, shared with userspace
124+
* data/hint flags for EVFILT_PROC and EVFILT_PROCDESC, shared with userspace
114125
*/
115126
NOTE_EXIT = 0x80000000, /* process exited */
116127
NOTE_FORK = 0x40000000, /* process forked */
@@ -122,6 +133,12 @@ enum
122133
NOTE_TRACK = 0x00000001, /* follow across forks */
123134
NOTE_TRACKERR = 0x00000002, /* could not track child */
124135
NOTE_CHILD = 0x00000004, /* am a child process */
136+
137+
/* additional flags for EVFILT_TIMER */
138+
NOTE_SECONDS = 0x00000001, /* data is seconds */
139+
NOTE_MSECONDS = 0x00000002, /* data is milliseconds */
140+
NOTE_USECONDS = 0x00000004, /* data is microseconds */
141+
NOTE_NSECONDS = 0x00000008, /* data is nanoseconds */
125142
}
126143

127144
int kqueue();

0 commit comments

Comments
 (0)