summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2018-01-13 12:58:41 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2018-01-13 12:58:41 +0000
commita6c5637f7626800961acb3367c954b98c84ff216 (patch)
tree0b8d0ee4405852cc38e292b9e405ab4db2db52ed /lib
parentf10ca47aed20ed74fd261080bf1e22c40c944516 (diff)
introduce a filter called EVFILT_DEVICE that can be used to notify
listeners of device state changes. currently only supports NOTE_CHANGE that will be used by drm(4) ok kettenis@
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/kqueue.217
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index 7dbd3a55c9b..41fbc23db6f 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: kqueue.2,v 1.35 2017/07/10 06:38:07 dlg Exp $
+.\" $OpenBSD: kqueue.2,v 1.36 2018/01/13 12:58:40 robert Exp $
.\"
.\" Copyright (c) 2000 Jonathan Lemon
.\" All rights reserved.
@@ -26,7 +26,7 @@
.\"
.\" $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.18 2001/02/14 08:48:35 guido Exp $
.\"
-.Dd $Mdocdate: July 10 2017 $
+.Dd $Mdocdate: January 13 2018 $
.Dt KQUEUE 2
.Os
.Sh NAME
@@ -451,6 +451,19 @@ contains the number of times the timeout has expired since the last call to
This filter automatically sets the
.Dv EV_CLEAR
flag internally.
+.It Dv EVFILT_DEVICE
+Takes a descriptor as the identifier, and the events to watch for in
+.Va fflags ,
+and returns when one or more of the reuqested events occur on the
+descriptor. The events to monitor are:
+.Bl -tag -width XXNOTE_CHANGE
+.It Dv NOTE_CHANGE
+A device change event has occured, e.g. an HDMI cable has been plugged in to a port.
+.El
+.Pp
+On return,
+.Va fflags
+contains the events which triggered the filter.
.El
.Sh RETURN VALUES
.Fn kqueue