listeners of device state changes.
currently only supports NOTE_CHANGE that will be used by drm(4)
ok kettenis@
-.\" $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.
.\"
.\" $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
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
-/* $OpenBSD: kern_event.c,v 1.83 2017/12/18 10:10:53 mpi Exp $ */
+/* $OpenBSD: kern_event.c,v 1.84 2018/01/13 12:58:40 robert Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
&proc_filtops, /* EVFILT_PROC */
&sig_filtops, /* EVFILT_SIGNAL */
&timer_filtops, /* EVFILT_TIMER */
+ &file_filtops, /* EVFILT_DEVICE */
};
void KQREF(struct kqueue *);
-/* $OpenBSD: event.h,v 1.29 2017/12/21 21:04:38 millert Exp $ */
+/* $OpenBSD: event.h,v 1.30 2018/01/13 12:58:40 robert Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
#define EVFILT_PROC (-5) /* attached to struct process */
#define EVFILT_SIGNAL (-6) /* attached to struct process */
#define EVFILT_TIMER (-7) /* timers */
+#define EVFILT_DEVICE (-8) /* devices */
-#define EVFILT_SYSCOUNT 7
+#define EVFILT_SYSCOUNT 8
#define EV_SET(kevp_, a, b, c, d, e, f) do { \
struct kevent *kevp = (kevp_); \
#define NOTE_TRACKERR 0x00000002 /* could not track child */
#define NOTE_CHILD 0x00000004 /* am a child process */
+/* data/hint flags for EVFILT_DEVICE, shared with userspace */
+#define NOTE_CHANGE 0x00000001 /* device change event */
+
/*
* This is currently visible to userland to work around broken
* programs which pull in <sys/proc.h> or <sys/selinfo.h>.