From e0261a0fe1ba151aaee365fbfb4d2080ee71d66d Mon Sep 17 00:00:00 2001 From: Visa Hankala Date: Mon, 20 Dec 2021 16:22:25 +0000 Subject: Let poll(2) register EVFILT_EXCEPT filter with dead vnodes This enables the system deliver POLLHUP when pollfd.events == 0. --- sys/miscfs/deadfs/dead_vnops.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index c36111f1cb2..3459569c0e6 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dead_vnops.c,v 1.39 2021/12/12 09:14:59 visa Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.40 2021/12/20 16:22:24 visa Exp $ */ /* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* @@ -180,6 +180,11 @@ dead_kqfilter(void *v) case EVFILT_WRITE: ap->a_kn->kn_fop = &dead_filtops; break; + case EVFILT_EXCEPT: + if ((ap->a_kn->kn_flags & __EV_POLL) == 0) + return (EINVAL); + ap->a_kn->kn_fop = &dead_filtops; + break; default: return (EINVAL); } -- cgit v1.2.3