aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/event.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2017-06-17 00:57:26 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2017-06-17 00:57:26 +0000
commit2b34e84335149a2d464c8e4b1334fb8f65a1fa8f (patch)
treed91d2c296ad043d944aa75f9d9a8635198860982 /sys/sys/event.h
parentf2eb97b2cded8209e6d0d35930507dcfcf5bc794 (diff)
downloadsrc-2b34e84335149a2d464c8e4b1334fb8f65a1fa8f.tar.gz
src-2b34e84335149a2d464c8e4b1334fb8f65a1fa8f.zip
Add abstime kqueue(2) timers and expand struct kevent members.
This change implements NOTE_ABSTIME flag for EVFILT_TIMER, which specifies that the data field contains absolute time to fire the event. To make this useful, data member of the struct kevent must be extended to 64bit. Using the opportunity, I also added ext members. This changes struct kevent almost to Apple struct kevent64, except I did not changed type of ident and udata, the later would cause serious API incompatibilities. The type of ident was kept uintptr_t since EVFILT_AIO returns a pointer in this field, and e.g. CHERI is sensitive to the type (discussed with brooks, jhb). Unlike Apple kevent64, symbol versioning allows us to claim ABI compatibility and still name the new syscall kevent(2). Compat shims are provided for both host native and compat32. Requested by: bapt Reviewed by: bapt, brooks, ngie (previous version) Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D11025
Notes
Notes: svn path=/head/; revision=320043
Diffstat (limited to 'sys/sys/event.h')
-rw-r--r--sys/sys/event.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/sys/event.h b/sys/sys/event.h
index 81d4a4750dac..ce93018caded 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -55,6 +55,10 @@
(kevp)->fflags = (d); \
(kevp)->data = (e); \
(kevp)->udata = (f); \
+ (kevp)->ext[0] = 0; \
+ (kevp)->ext[1] = 0; \
+ (kevp)->ext[2] = 0; \
+ (kevp)->ext[3] = 0; \
} while(0)
struct kevent {
@@ -62,8 +66,9 @@ struct kevent {
short filter; /* filter for event */
unsigned short flags;
unsigned int fflags;
- __intptr_t data;
+ __int64_t data;
void *udata; /* opaque user data identifier */
+ __uint64_t ext[4];
};
/* actions */
@@ -149,6 +154,7 @@ struct kevent {
#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */
#define NOTE_USECONDS 0x00000004 /* data is microseconds */
#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */
+#define NOTE_ABSTIME 0x00000010 /* timeout is absolute */
struct knote;
SLIST_HEAD(klist, knote);
@@ -232,7 +238,7 @@ struct knote {
#define KN_SCAN 0x100 /* flux set in kqueue_scan() */
int kn_influx;
int kn_sfflags; /* saved filter flags */
- intptr_t kn_sdata; /* saved data field */
+ int64_t kn_sdata; /* saved data field */
union {
struct file *p_fp; /* file data pointer */
struct proc *p_proc; /* proc pointer */
@@ -253,6 +259,7 @@ struct kevent_copyops {
void *arg;
int (*k_copyout)(void *arg, struct kevent *kevp, int count);
int (*k_copyin)(void *arg, struct kevent *kevp, int count);
+ size_t kevent_size;
};
struct thread;