Also remove unneeded includes of <sys/poll.h> and <sys/select.h>.
Some addenda from jsg@.
OK miod@ mpi@
-/* $OpenBSD: adb.c,v 1.45 2022/03/13 12:33:01 mpi Exp $ */
+/* $OpenBSD: adb.c,v 1.46 2022/07/02 08:50:41 visa Exp $ */
/* $NetBSD: adb.c,v 1.6 1999/08/16 06:28:09 tsubai Exp $ */
/* $NetBSD: adb_direct.c,v 1.14 2000/06/08 22:10:45 tsubai Exp $ */
#include <sys/param.h>
#include <sys/device.h>
#include <sys/fcntl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/timeout.h>
-/* $OpenBSD: akbd_machdep.c,v 1.2 2019/09/03 17:51:52 deraadt Exp $ */
+/* $OpenBSD: akbd_machdep.c,v 1.3 2022/07/02 08:50:41 visa Exp $ */
/* $NetBSD: akbd.c,v 1.13 2001/01/25 14:08:55 tsubai Exp $ */
/*
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/fcntl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/systm.h>
-/* $OpenBSD: scif.c,v 1.21 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: scif.c,v 1.22 2022/07/02 08:50:41 visa Exp $ */
/* $NetBSD: scif.c,v 1.47 2006/07/23 22:06:06 ad Exp $ */
/*-
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
-#if 0
-int
-scifpoll(dev_t dev, int events, struct proc *p)
-{
- struct scif_softc *sc = scif_cd.cd_devs[SCIFUNIT(dev)];
- struct tty *tp = sc->sc_tty;
-
- return ((*linesw[tp->t_line].l_poll)(tp, events, p));
-}
-#endif
-
struct tty *
sciftty(dev_t dev)
{
-/* $OpenBSD: vldcp.c,v 1.22 2021/10/24 17:05:04 mpi Exp $ */
+/* $OpenBSD: vldcp.c,v 1.23 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2009, 2012 Mark Kettenis
*
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/systm.h>
return (0);
}
-int
-vldcppoll(dev_t dev, int events, struct proc *p)
-{
- struct vldcp_softc *sc;
- struct ldc_conn *lc;
- uint64_t head, tail, state;
- int revents = 0;
- int s, err;
-
- sc = vldcp_lookup(dev);
- if (sc == NULL)
- return (POLLERR);
- lc = &sc->sc_lc;
-
- s = spltty();
- if (events & (POLLIN | POLLRDNORM)) {
- err = hv_ldc_rx_get_state(lc->lc_id, &head, &tail, &state);
-
- if (err == 0 && state == LDC_CHANNEL_UP && head != tail)
- revents |= events & (POLLIN | POLLRDNORM);
- }
- if (events & (POLLOUT | POLLWRNORM)) {
- err = hv_ldc_tx_get_state(lc->lc_id, &head, &tail, &state);
-
- if (err == 0 && state == LDC_CHANNEL_UP && head != tail)
- revents |= events & (POLLOUT | POLLWRNORM);
- }
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM)) {
- cbus_intr_setenabled(sc->sc_bustag, sc->sc_rx_ino,
- INTR_ENABLED);
- selrecord(p, &sc->sc_rsel);
- }
- if (events & (POLLOUT | POLLWRNORM)) {
- cbus_intr_setenabled(sc->sc_bustag, sc->sc_tx_ino,
- INTR_ENABLED);
- selrecord(p, &sc->sc_wsel);
- }
- }
- splx(s);
- return revents;
-}
-
void
filt_vldcprdetach(struct knote *kn)
{
-/* $OpenBSD: audio.c,v 1.198 2022/03/21 19:22:39 miod Exp $ */
+/* $OpenBSD: audio.c,v 1.199 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2015 Alexandre Ratchov <alex@caoua.org>
*
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/conf.h>
-#include <sys/poll.h>
#include <sys/kernel.h>
#include <sys/task.h>
#include <sys/vnode.h>
return 0;
}
-int
-audio_mixer_poll(struct audio_softc *sc, int events, struct proc *p)
-{
- int revents = 0;
-
- mtx_enter(&audio_lock);
- if (sc->mix_isopen && sc->mix_pending)
- revents |= events & (POLLIN | POLLRDNORM);
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &sc->mix_sel);
- }
- mtx_leave(&audio_lock);
- return revents;
-}
-
int
audio_mixer_open(struct audio_softc *sc, int flags)
{
return 0;
}
-int
-audio_poll(struct audio_softc *sc, int events, struct proc *p)
-{
- int revents = 0;
-
- mtx_enter(&audio_lock);
- if ((sc->mode & AUMODE_RECORD) && sc->rec.used > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- if ((sc->mode & AUMODE_PLAY) && sc->play.used < sc->play.len)
- revents |= events & (POLLOUT | POLLWRNORM);
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &sc->rec.sel);
- if (events & (POLLOUT | POLLWRNORM))
- selrecord(p, &sc->play.sel);
- }
- mtx_leave(&audio_lock);
- return revents;
-}
-
int
audioopen(dev_t dev, int flags, int mode, struct proc *p)
{
return error;
}
-int
-audiopoll(dev_t dev, int events, struct proc *p)
-{
- struct audio_softc *sc;
- int revents;
-
- sc = (struct audio_softc *)device_lookup(&audio_cd, AUDIO_UNIT(dev));
- if (sc == NULL)
- return POLLERR;
- switch (AUDIO_DEV(dev)) {
- case AUDIO_DEV_AUDIO:
- revents = audio_poll(sc, events, p);
- break;
- case AUDIO_DEV_AUDIOCTL:
- revents = audio_mixer_poll(sc, events, p);
- break;
- default:
- revents = 0;
- break;
- }
- device_unref(&sc->dev);
- return revents;
-}
-
int
audiokqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: cons.c,v 1.29 2020/04/03 08:24:52 mpi Exp $ */
+/* $OpenBSD: cons.c,v 1.30 2022/07/02 08:50:41 visa Exp $ */
/* $NetBSD: cons.c,v 1.30 1996/04/08 19:57:30 jonathan Exp $ */
/*
#include <sys/tty.h>
#include <sys/conf.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <dev/cons.h>
return ((*cdevsw[major(dev)].d_ioctl)(dev, cmd, data, flag, p));
}
-/*ARGSUSED*/
-int
-cnpoll(dev_t dev, int rw, struct proc *p)
-{
-
- /*
- * Redirect the poll, if that's appropriate.
- * I don't want to think of the possible side effects
- * of console redirection here.
- */
- if (constty != NULL)
- dev = constty->t_dev;
- else if (cn_tab == NULL)
- return POLLERR;
- else
- dev = cn_tab->cn_dev;
- return (ttpoll(dev, rw, p));
-}
-
-
int
cnkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: cons.h,v 1.18 2016/05/17 23:43:47 bluhm Exp $ */
+/* $OpenBSD: cons.h,v 1.19 2022/07/02 08:50:41 visa Exp $ */
/* $NetBSD: cons.h,v 1.14 1996/03/14 19:08:35 christos Exp $ */
/*
int cnread(dev_t, struct uio *, int);
int cnwrite(dev_t, struct uio *, int);
int cnioctl(dev_t, u_long, caddr_t, int, struct proc *);
-int cnpoll(dev_t, int, struct proc *);
int cnkqfilter(dev_t, struct knote *);
int cngetc(void);
void cnputc(int);
-/* $OpenBSD: exuart.c,v 1.10 2022/04/06 18:59:28 naddy Exp $ */
+/* $OpenBSD: exuart.c,v 1.11 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
#include <sys/syslog.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/select.h>
#include <sys/kernel.h>
#include <machine/bus.h>
-/* $OpenBSD: imxuart.c,v 1.12 2021/10/24 17:52:26 mpi Exp $ */
+/* $OpenBSD: imxuart.c,v 1.13 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2005 Dale Rahn <drahn@motorola.com>
*
#include <sys/syslog.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/select.h>
#include <sys/kernel.h>
#include <machine/bus.h>
-/* $OpenBSD: gpiodcf.c,v 1.9 2020/06/24 22:03:41 cheloha Exp $ */
+/* $OpenBSD: gpiodcf.c,v 1.10 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2008 Marc Balmer <mbalmer@openbsd.org>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
-#include <sys/select.h>
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <sys/time.h>
#include <sys/sensors.h>
#include <sys/gpio.h>
-/* $OpenBSD: hotplug.c,v 1.21 2020/12/25 12:59:52 visa Exp $ */
+/* $OpenBSD: hotplug.c,v 1.22 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
#include <sys/fcntl.h>
#include <sys/hotplug.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
#include <sys/vnode.h>
#define HOTPLUG_MAXEVENTS 64
return (0);
}
-int
-hotplugpoll(dev_t dev, int events, struct proc *p)
-{
- int revents = 0;
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (evqueue_count > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &hotplug_sel);
- }
-
- return (revents);
-}
-
int
hotplugkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: pluart.c,v 1.13 2022/06/28 16:28:08 anton Exp $ */
+/* $OpenBSD: pluart.c,v 1.14 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2014 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2005 Dale Rahn <drahn@dalerahn.com>
#include <sys/syslog.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/select.h>
#include <sys/kernel.h>
#include <machine/bus.h>
-/* $OpenBSD: midi.c,v 1.54 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: midi.c,v 1.55 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2003, 2004 Alexandre Ratchov
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/conf.h>
-#include <sys/poll.h>
#include <sys/kernel.h>
#include <sys/timeout.h>
#include <sys/vnode.h>
int midiclose(dev_t, int, int, struct proc *);
int midiread(dev_t, struct uio *, int);
int midiwrite(dev_t, struct uio *, int);
-int midipoll(dev_t, int, struct proc *);
int midikqfilter(dev_t, struct knote *);
int midiioctl(dev_t, u_long, caddr_t, int, struct proc *);
int midiprobe(struct device *, void *, void *);
return error;
}
-int
-midipoll(dev_t dev, int events, struct proc *p)
-{
- struct midi_softc *sc;
- int revents;
-
- sc = (struct midi_softc *)device_lookup(&midi_cd, minor(dev));
- if (sc == NULL)
- return POLLERR;
- revents = 0;
- mtx_enter(&audio_lock);
- if (events & (POLLIN | POLLRDNORM)) {
- if (!MIDIBUF_ISEMPTY(&sc->inbuf))
- revents |= events & (POLLIN | POLLRDNORM);
- }
- if (events & (POLLOUT | POLLWRNORM)) {
- if (!MIDIBUF_ISFULL(&sc->outbuf))
- revents |= events & (POLLOUT | POLLWRNORM);
- }
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &sc->inbuf.sel);
- if (events & (POLLOUT | POLLWRNORM))
- selrecord(p, &sc->outbuf.sel);
- }
- mtx_leave(&audio_lock);
- device_unref(&sc->dev);
- return (revents);
-}
-
int
midikqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: bktr_os.c,v 1.36 2022/03/21 19:22:41 miod Exp $ */
+/* $OpenBSD: bktr_os.c,v 1.37 2022/07/02 08:50:42 visa Exp $ */
/* $FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.20 2000/10/20 08:16:53 roger Exp $ */
/*
#include <sys/kernel.h>
#include <sys/signalvar.h>
#include <sys/mman.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <sys/vnode.h>
#if NRADIO > 0
#include <sys/radioio.h>
#include <sys/param.h>
#include <sys/fcntl.h>
-#include <sys/poll.h>
#include <sys/specdev.h>
#include <sys/vnode.h>
return (gotone);
}
-int
-drmpoll(dev_t kdev, int events, struct proc *p)
-{
- struct drm_device *dev = drm_get_device_from_kdev(kdev);
- struct drm_file *file_priv;
- int revents = 0;
-
- if (dev == NULL)
- return (POLLERR);
-
- mutex_lock(&dev->filelist_mutex);
- file_priv = drm_find_file_by_minor(dev, minor(kdev));
- mutex_unlock(&dev->filelist_mutex);
- if (file_priv == NULL)
- return (POLLERR);
-
- mtx_enter(&dev->event_lock);
- if (events & (POLLIN | POLLRDNORM)) {
- if (!list_empty(&file_priv->event_list))
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &file_priv->rsel);
- }
- mtx_leave(&dev->event_lock);
-
- return (revents);
-}
-
paddr_t
drmmmap(dev_t kdev, off_t offset, int prot)
{
-/* $OpenBSD: magma.c,v 1.34 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: magma.c,v 1.35 2022/07/02 08:50:42 visa Exp $ */
/*-
* Copyright (c) 1998 Iain Hibbert
* mbppread read from mbpp
* mbppwrite write to mbpp
* mbppioctl do ioctl on mbpp
- * mbpppoll do poll on mbpp
* mbppkqfilter kqueue on mbpp
* mbpp_rw general rw routine
* mbpp_timeout rw timeout
return (error);
}
-/*
- * poll routine
- */
-int
-mbpppoll(dev_t dev, int events, struct proc *p)
-{
- return (seltrue(dev, events, p));
-}
-
int
mbppkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: spif.c,v 1.26 2022/03/13 13:34:54 mpi Exp $ */
+/* $OpenBSD: spif.c,v 1.27 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net)
int sbppwrite(dev_t, struct uio *, int);
int sbpp_rw(dev_t, struct uio *);
int spifppcintr(void *);
-int sbpppoll(dev_t, int, struct proc *);
int sbppkqfilter(dev_t, struct knote *);
int sbppioctl(dev_t, u_long, caddr_t, int, struct proc *);
return (ENXIO);
}
-int
-sbpppoll(dev_t dev, int events, struct proc *p)
-{
- return (seltrue(dev, events, p));
-}
int
sbppkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: dwc2.c,v 1.61 2022/05/01 10:28:54 mglocker Exp $ */
+/* $OpenBSD: dwc2.c,v 1.62 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/device.h>
-#include <sys/select.h>
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/endian.h>
-/* $OpenBSD: fido.c,v 1.4 2021/11/15 15:36:24 anton Exp $ */
+/* $OpenBSD: fido.c,v 1.5 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2019 Reyk Floeter <reyk@openbsd.org>
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
-/* $OpenBSD: ubsa.c,v 1.68 2022/04/09 20:07:44 naddy Exp $ */
+/* $OpenBSD: ubsa.c,v 1.69 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */
/*-
* Copyright (c) 2002, Alexander Kabaev <kan.FreeBSD.org>.
#include <sys/fcntl.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbcdc.h>
-/* $OpenBSD: ucom.c,v 1.73 2022/06/27 13:14:49 jan Exp $ */
+/* $OpenBSD: ucom.c,v 1.74 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */
/*
#include <sys/conf.h>
#include <sys/tty.h>
#include <sys/fcntl.h>
-#include <sys/selinfo.h>
#include <sys/vnode.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
-/* $OpenBSD: udcf.c,v 1.64 2020/06/24 22:03:41 cheloha Exp $ */
+/* $OpenBSD: udcf.c,v 1.65 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Marc Balmer <mbalmer@openbsd.org>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
-#include <sys/select.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <sys/time.h>
#include <sys/sensors.h>
#include <sys/timeout.h>
-/* $OpenBSD: ugen.c,v 1.115 2021/02/05 08:17:22 mglocker Exp $ */
+/* $OpenBSD: ugen.c,v 1.116 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
#include <sys/fcntl.h>
#include <sys/selinfo.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <machine/bus.h>
return (error);
}
-int
-ugenpoll(dev_t dev, int events, struct proc *p)
-{
- struct ugen_softc *sc;
- struct ugen_endpoint *sce;
- int revents = 0;
- int s;
-
- sc = ugen_cd.cd_devs[UGENUNIT(dev)];
-
- if (usbd_is_dying(sc->sc_udev))
- return (POLLERR);
-
- /* XXX always IN */
- sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
- if (sce == NULL)
- return (POLLERR);
-#ifdef DIAGNOSTIC
- if (!sce->edesc) {
- printf("ugenpoll: no edesc\n");
- return (POLLERR);
- }
- if (!sce->pipeh) {
- printf("ugenpoll: no pipe\n");
- return (POLLERR);
- }
-#endif
- s = splusb();
- switch (UE_GET_XFERTYPE(sce->edesc->bmAttributes)) {
- case UE_INTERRUPT:
- if (events & (POLLIN | POLLRDNORM)) {
- if (sce->q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sce->rsel);
- }
- break;
- case UE_ISOCHRONOUS:
- if (events & (POLLIN | POLLRDNORM)) {
- if (sce->cur != sce->fill)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sce->rsel);
- }
- break;
- case UE_BULK:
- /*
- * We have no easy way of determining if a read will
- * yield any data or a write will happen.
- * Pretend they will.
- */
- revents |= events &
- (POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM);
- break;
- default:
- break;
- }
- splx(s);
- return (revents);
-}
-
void filt_ugenrdetach(struct knote *);
int filt_ugenread_intr(struct knote *, long);
int filt_ugenread_isoc(struct knote *, long);
-/* $OpenBSD: uhid.c,v 1.88 2021/11/15 15:36:24 anton Exp $ */
+/* $OpenBSD: uhid.c,v 1.89 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbhid.h>
return (error);
}
-int
-uhidpoll(dev_t dev, int events, struct proc *p)
-{
- struct uhid_softc *sc;
- int revents = 0;
- int s;
-
- if ((sc = uhid_lookup(dev)) == NULL)
- return (POLLERR);
-
- if (usbd_is_dying(sc->sc_hdev.sc_udev))
- return (POLLHUP);
-
- s = splusb();
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->sc_q.c_cc > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->sc_rsel);
- }
-
- splx(s);
- return (revents);
-}
-
void filt_uhidrdetach(struct knote *);
int filt_uhidread(struct knote *, long);
int uhidkqfilter(dev_t, struct knote *);
-/* $OpenBSD: ujoy.c,v 1.3 2021/11/15 15:36:24 anton Exp $ */
+/* $OpenBSD: ujoy.c,v 1.4 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2021 Thomas Frohwein <thfr@openbsd.org>
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
#include <sys/proc.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <sys/fcntl.h>
#include <dev/usb/usb.h>
-/* $OpenBSD: umbg.c,v 1.27 2020/07/31 10:49:33 mglocker Exp $ */
+/* $OpenBSD: umbg.c,v 1.28 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2007 Marc Balmer <mbalmer@openbsd.org>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/conf.h>
-#include <sys/select.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <sys/time.h>
#include <sys/sensors.h>
#include <sys/timeout.h>
-/* $OpenBSD: umct.c,v 1.49 2022/04/09 20:07:44 naddy Exp $ */
+/* $OpenBSD: umct.c,v 1.50 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbcdc.h>
-/* $OpenBSD: umidi.c,v 1.55 2022/03/21 19:22:42 miod Exp $ */
+/* $OpenBSD: umidi.c,v 1.56 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/selinfo.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
-/* $OpenBSD: umidi_quirks.c,v 1.16 2018/01/18 18:09:38 ratchov Exp $ */
+/* $OpenBSD: umidi_quirks.c,v 1.17 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: umidi_quirks.c,v 1.4 2002/06/19 13:55:30 tshiozak Exp $ */
/*
#include <sys/device.h>
#include <sys/ioctl.h>
#include <sys/conf.h>
-#include <sys/selinfo.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
-/* $OpenBSD: umodem.c,v 1.68 2022/04/09 20:07:44 naddy Exp $ */
+/* $OpenBSD: umodem.c,v 1.69 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */
/*
#include <sys/kernel.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbcdc.h>
-/* $OpenBSD: uplcom.c,v 1.79 2022/04/09 20:07:44 naddy Exp $ */
+/* $OpenBSD: uplcom.c,v 1.80 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
#include <sys/ioctl.h>
#include <sys/conf.h>
#include <sys/tty.h>
-#include <sys/selinfo.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbcdc.h>
-/* $OpenBSD: usb.c,v 1.129 2022/01/09 05:43:02 jsg Exp $ */
+/* $OpenBSD: usb.c,v 1.130 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
#include <sys/kthread.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <sys/signalvar.h>
#include <sys/time.h>
#include <sys/rwlock.h>
-/* $OpenBSD: uvideo.c,v 1.216 2022/03/21 19:22:42 miod Exp $ */
+/* $OpenBSD: uvideo.c,v 1.217 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/fcntl.h>
-#include <sys/selinfo.h>
#include <sys/lock.h>
#include <sys/stat.h>
-#include <sys/poll.h>
#include <sys/timeout.h>
#include <sys/kthread.h>
#include <sys/stdint.h>
-/* $OpenBSD: uvscom.c,v 1.41 2022/04/09 20:07:44 naddy Exp $ */
+/* $OpenBSD: uvscom.c,v 1.42 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */
/*-
* Copyright (c) 2001-2002, Shunsuke Akiyama <akiyama@jp.FreeBSD.org>.
#include <sys/tty.h>
#include <sys/ioctl.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbcdc.h>
-/* $OpenBSD: video.c,v 1.56 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: video.c,v 1.57 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
-#include <sys/poll.h>
#include <sys/device.h>
#include <sys/vnode.h>
#include <sys/kernel.h>
return (error);
}
-int
-videopoll(dev_t dev, int events, struct proc *p)
-{
- int unit = VIDEOUNIT(dev);
- struct video_softc *sc;
- int error, revents = 0;
-
- KERNEL_ASSERT_LOCKED();
-
- if (unit >= video_cd.cd_ndevs ||
- (sc = video_cd.cd_devs[unit]) == NULL)
- return (POLLERR);
-
- if (sc->sc_dying)
- return (POLLERR);
-
- if ((error = video_claim(sc, p->p_p)))
- return (error);
-
- DPRINTF(1, "%s: events=0x%x\n", __func__, events);
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (sc->sc_frames_ready > 0)
- revents |= events & (POLLIN | POLLRDNORM);
- }
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM)) {
- /*
- * Start the stream in read() mode if not already
- * started. If the user wanted mmap() mode,
- * he should have called mmap() before now.
- */
- if (sc->sc_vidmode == VIDMODE_NONE &&
- sc->hw_if->start_read) {
- error = sc->hw_if->start_read(sc->hw_hdl);
- if (error)
- return (POLLERR);
- sc->sc_vidmode = VIDMODE_READ;
- }
- selrecord(p, &sc->sc_rsel);
- }
- }
-
- DPRINTF(1, "%s: revents=0x%x\n", __func__, revents);
-
- return (revents);
-}
-
paddr_t
videommap(dev_t dev, off_t off, int prot)
{
-/* $OpenBSD: vscsi.c,v 1.60 2022/04/16 19:19:58 naddy Exp $ */
+/* $OpenBSD: vscsi.c,v 1.61 2022/07/02 08:50:41 visa Exp $ */
/*
* Copyright (c) 2008 David Gwynne <dlg@openbsd.org>
#include <sys/pool.h>
#include <sys/task.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
free(dt, M_TEMP, sizeof(*dt));
}
-int
-vscsipoll(dev_t dev, int events, struct proc *p)
-{
- struct vscsi_softc *sc = DEV2SC(dev);
- int revents = 0;
-
- if (sc == NULL)
- return (POLLERR);
-
- if (events & (POLLIN | POLLRDNORM)) {
- mtx_enter(&sc->sc_state_mtx);
- if (!TAILQ_EMPTY(&sc->sc_ccb_i2t))
- revents |= events & (POLLIN | POLLRDNORM);
- mtx_leave(&sc->sc_state_mtx);
- }
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &sc->sc_sel);
- }
-
- device_unref(&sc->sc_dev);
- return (revents);
-}
-
int
vscsikqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: wsdisplay.c,v 1.145 2022/06/20 16:28:42 gnezdo Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.146 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
#include <sys/fcntl.h>
#include <sys/vnode.h>
#include <sys/timeout.h>
-#include <sys/poll.h>
#include <dev/wscons/wscons_features.h>
#include <dev/wscons/wsconsio.h>
return ((*sc->sc_accessops->mmap)(sc->sc_accesscookie, offset, prot));
}
-int
-wsdisplaypoll(dev_t dev, int events, struct proc *p)
-{
- struct wsdisplay_softc *sc = wsdisplay_cd.cd_devs[WSDISPLAYUNIT(dev)];
- struct wsscreen *scr;
-
- if (ISWSDISPLAYCTL(dev))
- return (0);
-
- if ((scr = sc->sc_scr[WSDISPLAYSCREEN(dev)]) == NULL)
- return (POLLERR);
-
- if (!WSSCREEN_HAS_TTY(scr))
- return (POLLERR);
-
- return (ttpoll(dev, events, p));
-}
-
int
wsdisplaykqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: wsevent.c,v 1.25 2020/12/25 12:59:52 visa Exp $ */
+/* $OpenBSD: wsevent.c,v 1.26 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wsevent.c,v 1.16 2003/08/07 16:31:29 agc Exp $ */
/*
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/vnode.h>
-#include <sys/selinfo.h>
-#include <sys/poll.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wseventvar.h>
}
/*
- * User-level interface: read, poll.
+ * User-level interface: read, kqueue.
* (User cannot write an event queue.)
*/
int
return (error);
}
-int
-wsevent_poll(struct wseventvar *ev, int events, struct proc *p)
-{
- int revents = 0;
- int s = splwsevent();
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (ev->get != ev->put)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &ev->sel);
- }
-
- splx(s);
- return (revents);
-}
-
int
wsevent_kqfilter(struct wseventvar *ev, struct knote *kn)
{
-/* $OpenBSD: wseventvar.h,v 1.10 2019/05/22 18:52:14 anton Exp $ */
+/* $OpenBSD: wseventvar.h,v 1.11 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wseventvar.h,v 1.1 1998/03/22 14:24:03 drochner Exp $ */
/*
int wsevent_init(struct wseventvar *);
void wsevent_fini(struct wseventvar *);
int wsevent_read(struct wseventvar *, struct uio *, int);
-int wsevent_poll(struct wseventvar *, int, struct proc *);
int wsevent_kqfilter(struct wseventvar *, struct knote *);
/*
-/* $OpenBSD: wskbd.c,v 1.112 2022/04/06 18:59:30 naddy Exp $ */
+/* $OpenBSD: wskbd.c,v 1.113 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wskbd.c,v 1.80 2005/05/04 01:52:16 augustss Exp $ */
/*
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <ddb/db_var.h>
return (error);
}
-int
-wskbdpoll(dev_t dev, int events, struct proc *p)
-{
- struct wskbd_softc *sc = wskbd_cd.cd_devs[minor(dev)];
-
- if (sc->sc_base.me_evp == NULL)
- return (POLLERR);
- return (wsevent_poll(sc->sc_base.me_evp, events, p));
-}
-
int
wskbdkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: wsmouse.c,v 1.68 2022/04/06 18:59:30 naddy Exp $ */
+/* $OpenBSD: wsmouse.c,v 1.69 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wsmouse.c,v 1.35 2005/02/27 00:27:52 perry Exp $ */
/*
#include <sys/signalvar.h>
#include <sys/device.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <sys/malloc.h>
#include <dev/wscons/wscons_features.h>
return (error != -1 ? error : ENOTTY);
}
-int
-wsmousepoll(dev_t dev, int events, struct proc *p)
-{
- struct wsmouse_softc *sc = wsmouse_cd.cd_devs[minor(dev)];
-
- if (sc->sc_base.me_evp == NULL)
- return (POLLERR);
- return (wsevent_poll(sc->sc_base.me_evp, events, p));
-}
-
int
wsmousekqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: wsmux.c,v 1.55 2021/09/22 15:44:12 anton Exp $ */
+/* $OpenBSD: wsmux.c,v 1.56 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: wsmux.c,v 1.37 2005/04/30 03:47:12 augustss Exp $ */
/*
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <sys/device.h>
-#include <sys/poll.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsksymdef.h>
return (error);
}
-/*
- * poll() of the pseudo device from device table.
- */
-int
-wsmuxpoll(dev_t dev, int events, struct proc *p)
-{
- struct wsmux_softc *sc = wsmuxdevs[minor(dev)];
-
- if (sc->sc_base.me_evp == NULL) {
-#ifdef DIAGNOSTIC
- printf("wsmuxpoll: not open\n");
-#endif
- return (POLLERR);
- }
-
- return (wsevent_poll(sc->sc_base.me_evp, events, p));
-}
-
int
wsmuxkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: subr_log.c,v 1.74 2021/03/18 08:43:38 mvs Exp $ */
+/* $OpenBSD: subr_log.c,v 1.75 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */
/*
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <sys/syslog.h>
-#include <sys/poll.h>
#include <sys/malloc.h>
#include <sys/filedesc.h>
#include <sys/socket.h>
return (error);
}
-int
-logpoll(dev_t dev, int events, struct proc *p)
-{
- int revents = 0;
-
- mtx_enter(&log_mtx);
- if (events & (POLLIN | POLLRDNORM)) {
- if (msgbufp->msg_bufr != msgbufp->msg_bufx)
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &logsoftc.sc_selp);
- }
- mtx_leave(&log_mtx);
- return (revents);
-}
-
int
logkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: tty.c,v 1.174 2022/02/15 03:53:58 jsg Exp $ */
+/* $OpenBSD: tty.c,v 1.175 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
#include <sys/resourcevar.h>
#include <sys/sysctl.h>
#include <sys/pool.h>
-#include <sys/poll.h>
#include <sys/unistd.h>
#include <sys/pledge.h>
return (0);
}
-int
-ttpoll(dev_t device, int events, struct proc *p)
-{
- struct tty *tp;
- int revents, s;
-
- tp = (*cdevsw[major(device)].d_tty)(device);
-
- revents = 0;
- s = spltty();
- if (events & (POLLIN | POLLRDNORM)) {
- if (ttnread(tp) > 0 || (!ISSET(tp->t_cflag, CLOCAL) &&
- !ISSET(tp->t_state, TS_CARR_ON)))
- revents |= events & (POLLIN | POLLRDNORM);
- }
- /* NOTE: POLLHUP and POLLOUT/POLLWRNORM are mutually exclusive */
- if (!ISSET(tp->t_cflag, CLOCAL) && !ISSET(tp->t_state, TS_CARR_ON)) {
- revents |= POLLHUP;
- } else if (events & (POLLOUT | POLLWRNORM)) {
- if (tp->t_outq.c_cc <= tp->t_lowat)
- revents |= events & (POLLOUT | POLLWRNORM);
- }
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &tp->t_rsel);
- if (events & (POLLOUT | POLLWRNORM))
- selrecord(p, &tp->t_wsel);
- }
- splx(s);
- return (revents);
-}
-
const struct filterops ttyread_filtops = {
.f_flags = FILTEROP_ISFD,
.f_attach = NULL,
-/* $OpenBSD: tty_pty.c,v 1.112 2021/12/15 15:30:47 visa Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.113 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
#include <sys/conf.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
-#include <sys/poll.h>
#include <sys/pledge.h>
#include <sys/rwlock.h>
return (error);
}
-int
-ptcpoll(dev_t dev, int events, struct proc *p)
-{
- struct pt_softc *pti = pt_softc[minor(dev)];
- struct tty *tp = pti->pt_tty;
- int revents = 0, s;
-
- if (!ISSET(tp->t_state, TS_ISOPEN) && ISSET(tp->t_state, TS_CARR_ON))
- goto notopen;
-
- if (events & (POLLIN | POLLRDNORM)) {
- /*
- * Need to protect access to t_outq
- */
- s = spltty();
- if ((tp->t_outq.c_cc && !ISSET(tp->t_state, TS_TTSTOP)) ||
- ((pti->pt_flags & PF_PKT) && pti->pt_send) ||
- ((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl))
- revents |= events & (POLLIN | POLLRDNORM);
- splx(s);
- }
- /* NOTE: POLLHUP and POLLOUT/POLLWRNORM are mutually exclusive */
- if (!ISSET(tp->t_state, TS_CARR_ON)) {
- revents |= POLLHUP;
- } else if (events & (POLLOUT | POLLWRNORM)) {
- if ((pti->pt_flags & PF_REMOTE) ?
- (tp->t_canq.c_cc == 0) :
- ((tp->t_rawq.c_cc + tp->t_canq.c_cc < TTYHOG(tp) - 2) ||
- (tp->t_canq.c_cc == 0 && ISSET(tp->t_lflag, ICANON))))
- revents |= events & (POLLOUT | POLLWRNORM);
- }
- if (events & (POLLPRI | POLLRDBAND)) {
- /* If in packet or user control mode, check for data. */
- if (((pti->pt_flags & PF_PKT) && pti->pt_send) ||
- ((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl))
- revents |= events & (POLLPRI | POLLRDBAND);
- }
-
- if (revents == 0) {
-notopen:
- if (events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND))
- selrecord(p, &pti->pt_selr);
- if (events & (POLLOUT | POLLWRNORM))
- selrecord(p, &pti->pt_selw);
- }
-
- return (revents);
-}
-
void
filt_ptcrdetach(struct knote *kn)
{
-/* $OpenBSD: tty_tty.c,v 1.30 2022/06/26 05:20:42 visa Exp $ */
+/* $OpenBSD: tty_tty.c,v 1.31 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: tty_tty.c,v 1.13 1996/03/30 22:24:46 christos Exp $ */
/*-
return (VOP_IOCTL(ttyvp, cmd, addr, flag, NOCRED, p));
}
-int
-cttypoll(dev_t dev, int events, struct proc *p)
-{
- panic("not implemented");
- return (0);
-}
-
int
cttykqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: fuse_device.c,v 1.36 2021/03/11 13:31:35 jsg Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.37 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
#include <sys/ioctl.h>
#include <sys/malloc.h>
#include <sys/mount.h>
-#include <sys/poll.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/vnode.h>
int fuseioctl(dev_t, u_long, caddr_t, int, struct proc *);
int fuseread(dev_t, struct uio *, int);
int fusewrite(dev_t, struct uio *, int);
-int fusepoll(dev_t, int, struct proc *);
int fusekqfilter(dev_t dev, struct knote *kn);
int filt_fuse_read(struct knote *, long);
void filt_fuse_rdetach(struct knote *);
return (error);
}
-int
-fusepoll(dev_t dev, int events, struct proc *p)
-{
- struct fuse_d *fd;
- int revents = 0;
-
- fd = fuse_lookup(minor(dev));
- if (fd == NULL)
- return (POLLERR);
-
- if (events & (POLLIN | POLLRDNORM))
- if (!SIMPLEQ_EMPTY(&fd->fd_fbufs_in))
- revents |= events & (POLLIN | POLLRDNORM);
-
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
-
- if (revents == 0)
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &fd->fd_rsel);
-
- return (revents);
-}
-
int
fusekqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: bpf.c,v 1.216 2022/03/17 14:22:03 visa Exp $ */
+/* $OpenBSD: bpf.c,v 1.217 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */
/*
#include <sys/vnode.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
-#include <sys/poll.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <sys/rwlock.h>
int bpf_movein(struct uio *, struct bpf_d *, struct mbuf **,
struct sockaddr *);
int bpf_setif(struct bpf_d *, struct ifreq *);
-int bpfpoll(dev_t, int, struct proc *);
int bpfkqfilter(dev_t, struct knote *);
void bpf_wakeup(struct bpf_d *);
void bpf_wakeup_cb(void *);
bcopy(bif->bif_name, ifr->ifr_name, sizeof(ifr->ifr_name));
}
-/*
- * Support for poll() system call
- */
-int
-bpfpoll(dev_t dev, int events, struct proc *p)
-{
- struct bpf_d *d;
- int revents;
-
- KERNEL_ASSERT_LOCKED();
-
- /*
- * An imitation of the FIONREAD ioctl code.
- */
- d = bpfilter_lookup(minor(dev));
-
- /*
- * XXX The USB stack manages it to trigger some race condition
- * which causes bpfilter_lookup to return NULL when a USB device
- * gets detached while it is up and has an open bpf handler (e.g.
- * dhclient). We still should recheck if we can fix the root
- * cause of this issue.
- */
- if (d == NULL)
- return (POLLERR);
-
- /* Always ready to write data */
- revents = events & (POLLOUT | POLLWRNORM);
-
- if (events & (POLLIN | POLLRDNORM)) {
- mtx_enter(&d->bd_mtx);
- if (d->bd_hlen != 0 || (d->bd_immediate && d->bd_slen != 0))
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &d->bd_sel);
- mtx_leave(&d->bd_mtx);
- }
- return (revents);
-}
-
const struct filterops bpfread_filtops = {
.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
.f_attach = NULL,
-/* $OpenBSD: if_pppx.c,v 1.117 2022/06/26 22:51:58 mvs Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.118 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/vnode.h>
-#include <sys/poll.h>
#include <sys/selinfo.h>
#include <net/if.h>
return (error);
}
-int
-pppxpoll(dev_t dev, int events, struct proc *p)
-{
- struct pppx_dev *pxd = pppx_dev2pxd(dev);
- int revents = 0;
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (!mq_empty(&pxd->pxd_svcq))
- revents |= events & (POLLIN | POLLRDNORM);
- }
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &pxd->pxd_rsel);
- }
-
- return (revents);
-}
-
int
pppxkqfilter(dev_t dev, struct knote *kn)
{
return (error);
}
-int
-pppacpoll(dev_t dev, int events, struct proc *p)
-{
- struct pppac_softc *sc = pppac_lookup(dev);
- int revents = 0;
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (!mq_empty(&sc->sc_mq))
- revents |= events & (POLLIN | POLLRDNORM);
- }
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM))
- selrecord(p, &sc->sc_rsel);
- }
-
- return (revents);
-}
-
int
pppackqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: if_tun.c,v 1.236 2022/02/26 02:15:45 dlg Exp $ */
+/* $OpenBSD: if_tun.c,v 1.237 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
#include <sys/device.h>
#include <sys/vnode.h>
#include <sys/signalvar.h>
-#include <sys/poll.h>
#include <sys/conf.h>
#include <sys/smr.h>
int tun_dev_ioctl(dev_t, u_long, void *);
int tun_dev_read(dev_t, struct uio *, int);
int tun_dev_write(dev_t, struct uio *, int, int);
-int tun_dev_poll(dev_t, int, struct proc *);
int tun_dev_kqfilter(dev_t, struct knote *);
int tun_ioctl(struct ifnet *, u_long, caddr_t);
}
}
-/*
- * tunpoll - the poll interface, this is only useful on reads
- * really. The write detect always returns true, write never blocks
- * anyway, it either accepts the packet or drops it.
- */
-int
-tunpoll(dev_t dev, int events, struct proc *p)
-{
- return (tun_dev_poll(dev, events, p));
-}
-
-int
-tappoll(dev_t dev, int events, struct proc *p)
-{
- return (tun_dev_poll(dev, events, p));
-}
-
-int
-tun_dev_poll(dev_t dev, int events, struct proc *p)
-{
- struct tun_softc *sc;
- struct ifnet *ifp;
- int revents;
-
- sc = tun_get(dev);
- if (sc == NULL)
- return (POLLERR);
-
- ifp = &sc->sc_if;
- revents = 0;
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (!ifq_empty(&ifp->if_snd))
- revents |= events & (POLLIN | POLLRDNORM);
- else
- selrecord(p, &sc->sc_rsel);
- }
- if (events & (POLLOUT | POLLWRNORM))
- revents |= events & (POLLOUT | POLLWRNORM);
-
- tun_put(sc);
- return (revents);
-}
-
int
tunkqfilter(dev_t dev, struct knote *kn)
{
-/* $OpenBSD: pipex.c,v 1.142 2022/06/28 08:01:40 mvs Exp $ */
+/* $OpenBSD: pipex.c,v 1.143 2022/07/02 08:50:42 visa Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
#include <sys/mbuf.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include <sys/select.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/conf.h>
-/* $OpenBSD: mpath.c,v 1.56 2022/04/16 19:19:59 naddy Exp $ */
+/* $OpenBSD: mpath.c,v 1.57 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2009 David Gwynne <dlg@openbsd.org>
#include <sys/queue.h>
#include <sys/rwlock.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-/* $OpenBSD: mpath_emc.c,v 1.24 2021/10/24 16:57:30 mpi Exp $ */
+/* $OpenBSD: mpath_emc.c,v 1.25 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
#include <sys/rwlock.h>
#include <sys/pool.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-/* $OpenBSD: mpath_hds.c,v 1.25 2021/10/24 16:57:30 mpi Exp $ */
+/* $OpenBSD: mpath_hds.c,v 1.26 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2011 David Gwynne <dlg@openbsd.org>
#include <sys/rwlock.h>
#include <sys/pool.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-/* $OpenBSD: mpath_rdac.c,v 1.26 2021/10/24 16:57:30 mpi Exp $ */
+/* $OpenBSD: mpath_rdac.c,v 1.27 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
#include <sys/rwlock.h>
#include <sys/pool.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-/* $OpenBSD: mpath_sym.c,v 1.27 2021/10/24 16:57:30 mpi Exp $ */
+/* $OpenBSD: mpath_sym.c,v 1.28 2022/07/02 08:50:42 visa Exp $ */
/*
* Copyright (c) 2010 David Gwynne <dlg@openbsd.org>
#include <sys/rwlock.h>
#include <sys/pool.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/selinfo.h>
#include <scsi/scsi_all.h>
#include <scsi/scsiconf.h>
-/* $OpenBSD: tty.h,v 1.40 2021/12/02 15:13:49 deraadt Exp $ */
+/* $OpenBSD: tty.h,v 1.41 2022/07/02 08:50:42 visa Exp $ */
/* $NetBSD: tty.h,v 1.30.4.1 1996/06/02 09:08:13 mrg Exp $ */
/*-
struct proc *p);
int ttread(struct tty *tp, struct uio *uio, int flag);
void ttrstrt(void *tp);
-int ttpoll(dev_t device, int events, struct proc *p);
int ttkqfilter(dev_t dev, struct knote *kn);
void ttsetwater(struct tty *tp);
int ttspeedtab(int speed, const struct speedtab *table);
int cttyread(dev_t, struct uio *, int);
int cttywrite(dev_t, struct uio *, int);
int cttyioctl(dev_t, u_long, caddr_t, int, struct proc *);
-int cttypoll(dev_t, int, struct proc *);
void clalloc(struct clist *, int, int);
void clfree(struct clist *);