-/* $OpenBSD: drm_linux.c,v 1.92 2022/03/01 11:50:37 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.93 2022/06/20 01:39:44 visa Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
return (ENOTTY);
}
-int
-dmabuf_poll(struct file *fp, int events, struct proc *p)
-{
- return (0);
-}
-
int
dmabuf_kqfilter(struct file *fp, struct knote *kn)
{
.fo_read = dmabuf_read,
.fo_write = dmabuf_write,
.fo_ioctl = dmabuf_ioctl,
- .fo_poll = dmabuf_poll,
.fo_kqfilter = dmabuf_kqfilter,
.fo_stat = dmabuf_stat,
.fo_close = dmabuf_close,
return ENOTTY;
}
-int
-syncfile_poll(struct file *fp, int events, struct proc *p)
-{
- return 0;
-}
-
int
syncfile_kqfilter(struct file *fp, struct knote *kn)
{
.fo_read = syncfile_read,
.fo_write = syncfile_write,
.fo_ioctl = syncfile_ioctl,
- .fo_poll = syncfile_poll,
.fo_kqfilter = syncfile_kqfilter,
.fo_stat = syncfile_stat,
.fo_close = syncfile_close,
-/* $OpenBSD: kern_event.c,v 1.189 2022/06/12 10:34:36 visa Exp $ */
+/* $OpenBSD: kern_event.c,v 1.190 2022/06/20 01:39:44 visa Exp $ */
/*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/mount.h>
-#include <sys/poll.h>
#include <sys/syscallargs.h>
#include <sys/time.h>
#include <sys/timeout.h>
int kqueue_write(struct file *, struct uio *, int);
int kqueue_ioctl(struct file *fp, u_long com, caddr_t data,
struct proc *p);
-int kqueue_poll(struct file *fp, int events, struct proc *p);
int kqueue_kqfilter(struct file *fp, struct knote *kn);
int kqueue_stat(struct file *fp, struct stat *st, struct proc *p);
int kqueue_close(struct file *fp, struct proc *p);
.fo_read = kqueue_read,
.fo_write = kqueue_write,
.fo_ioctl = kqueue_ioctl,
- .fo_poll = kqueue_poll,
.fo_kqfilter = kqueue_kqfilter,
.fo_stat = kqueue_stat,
.fo_close = kqueue_close
return (ENOTTY);
}
-int
-kqueue_poll(struct file *fp, int events, struct proc *p)
-{
- struct kqueue *kq = (struct kqueue *)fp->f_data;
- int revents = 0;
-
- if (events & (POLLIN | POLLRDNORM)) {
- mtx_enter(&kq->kq_lock);
- if (kq->kq_count) {
- revents |= events & (POLLIN | POLLRDNORM);
- } else {
- selrecord(p, &kq->kq_sel);
- kq->kq_state |= KQ_SEL;
- }
- mtx_leave(&kq->kq_lock);
- }
- return (revents);
-}
-
int
kqueue_stat(struct file *fp, struct stat *st, struct proc *p)
{
-/* $OpenBSD: sys_pipe.c,v 1.139 2022/05/30 14:06:16 visa Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.140 2022/06/20 01:39:44 visa Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
#include <sys/syscallargs.h>
#include <sys/event.h>
#include <sys/lock.h>
-#include <sys/poll.h>
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
int pipe_read(struct file *, struct uio *, int);
int pipe_write(struct file *, struct uio *, int);
int pipe_close(struct file *, struct proc *);
-int pipe_poll(struct file *, int events, struct proc *);
int pipe_kqfilter(struct file *fp, struct knote *kn);
int pipe_ioctl(struct file *, u_long, caddr_t, struct proc *);
int pipe_stat(struct file *fp, struct stat *ub, struct proc *p);
.fo_read = pipe_read,
.fo_write = pipe_write,
.fo_ioctl = pipe_ioctl,
- .fo_poll = pipe_poll,
.fo_kqfilter = pipe_kqfilter,
.fo_stat = pipe_stat,
.fo_close = pipe_close
return (error);
}
-int
-pipe_poll(struct file *fp, int events, struct proc *p)
-{
- struct pipe *rpipe = fp->f_data, *wpipe;
- struct rwlock *lock = rpipe->pipe_lock;
- int revents = 0;
-
- rw_enter_write(lock);
- wpipe = pipe_peer(rpipe);
-
- if (events & (POLLIN | POLLRDNORM)) {
- if (rpipe->pipe_buffer.cnt > 0 ||
- (rpipe->pipe_state & PIPE_EOF))
- revents |= events & (POLLIN | POLLRDNORM);
- }
-
- /* NOTE: POLLHUP and POLLOUT/POLLWRNORM are mutually exclusive */
- if ((rpipe->pipe_state & PIPE_EOF) || wpipe == NULL)
- revents |= POLLHUP;
- else if (events & (POLLOUT | POLLWRNORM)) {
- if (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt >= PIPE_BUF)
- revents |= events & (POLLOUT | POLLWRNORM);
- }
-
- if (revents == 0) {
- if (events & (POLLIN | POLLRDNORM)) {
- selrecord(p, &rpipe->pipe_sel);
- rpipe->pipe_state |= PIPE_SEL;
- }
- if (events & (POLLOUT | POLLWRNORM)) {
- selrecord(p, &wpipe->pipe_sel);
- wpipe->pipe_state |= PIPE_SEL;
- }
- }
-
- rw_exit_write(lock);
-
- return (revents);
-}
-
int
pipe_stat(struct file *fp, struct stat *ub, struct proc *p)
{
-/* $OpenBSD: sys_socket.c,v 1.50 2022/06/06 14:45:41 claudio Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.51 2022/06/20 01:39:44 visa Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/ioctl.h>
-#include <sys/poll.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
.fo_read = soo_read,
.fo_write = soo_write,
.fo_ioctl = soo_ioctl,
- .fo_poll = soo_poll,
.fo_kqfilter = soo_kqfilter,
.fo_stat = soo_stat,
.fo_close = soo_close
return (error);
}
-int
-soo_poll(struct file *fp, int events, struct proc *p)
-{
- struct socket *so = fp->f_data;
- int revents = 0;
-
- solock(so);
- if (events & (POLLIN | POLLRDNORM)) {
- if (soreadable(so))
- revents |= events & (POLLIN | POLLRDNORM);
- }
- /* NOTE: POLLHUP and POLLOUT/POLLWRNORM are mutually exclusive */
- if (so->so_state & SS_ISDISCONNECTED) {
- revents |= POLLHUP;
- } else if (events & (POLLOUT | POLLWRNORM)) {
- if (sowriteable(so))
- revents |= events & (POLLOUT | POLLWRNORM);
- }
- if (events & (POLLPRI | POLLRDBAND)) {
- if (so->so_oobmark || (so->so_state & SS_RCVATMARK))
- revents |= events & (POLLPRI | POLLRDBAND);
- }
- if (revents == 0) {
- if (events & (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)) {
- selrecord(p, &so->so_rcv.sb_sel);
- so->so_rcv.sb_flags |= SB_SEL;
- }
- if (events & (POLLOUT | POLLWRNORM)) {
- selrecord(p, &so->so_snd.sb_sel);
- so->so_snd.sb_flags |= SB_SEL;
- }
- }
- sounlock(so);
- return (revents);
-}
-
int
soo_stat(struct file *fp, struct stat *ub, struct proc *p)
{
-/* $OpenBSD: vfs_vnops.c,v 1.119 2021/11/13 06:04:02 visa Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.120 2022/06/20 01:39:44 visa Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/cdio.h>
-#include <sys/poll.h>
#include <sys/filedesc.h>
#include <sys/specdev.h>
#include <sys/unistd.h>
int vn_read(struct file *, struct uio *, int);
int vn_write(struct file *, struct uio *, int);
-int vn_poll(struct file *, int, struct proc *);
int vn_kqfilter(struct file *, struct knote *);
int vn_closefile(struct file *, struct proc *);
int vn_seek(struct file *, off_t *, int, struct proc *);
.fo_read = vn_read,
.fo_write = vn_write,
.fo_ioctl = vn_ioctl,
- .fo_poll = vn_poll,
.fo_kqfilter = vn_kqfilter,
.fo_stat = vn_statfile,
.fo_close = vn_closefile,
return (error);
}
-/*
- * File table vnode poll routine.
- */
-int
-vn_poll(struct file *fp, int events, struct proc *p)
-{
- return (VOP_POLL(fp->f_data, fp->f_flag, events, p));
-}
-
/*
* Check that the vnode is still valid, and if so
* acquire requested lock.
-/* $OpenBSD: eventvar.h,v 1.14 2022/03/16 14:38:43 visa Exp $ */
+/* $OpenBSD: eventvar.h,v 1.15 2022/06/20 01:39:44 visa Exp $ */
/*-
* Copyright (c) 1999,2000 Jonathan Lemon <jlemon@FreeBSD.org>
struct task kq_task; /* deferring of activation */
int kq_state; /* [q] */
-#define KQ_SEL 0x01
#define KQ_SLEEP 0x02
#define KQ_DYING 0x04
};
-/* $OpenBSD: file.h,v 1.65 2022/01/20 03:43:31 jsg Exp $ */
+/* $OpenBSD: file.h,v 1.66 2022/06/20 01:39:44 visa Exp $ */
/* $NetBSD: file.h,v 1.11 1995/03/26 20:24:13 jtc Exp $ */
/*
int (*fo_read)(struct file *, struct uio *, int);
int (*fo_write)(struct file *, struct uio *, int);
int (*fo_ioctl)(struct file *, u_long, caddr_t, struct proc *);
- int (*fo_poll)(struct file *, int, struct proc *);
int (*fo_kqfilter)(struct file *, struct knote *);
int (*fo_stat)(struct file *, struct stat *, struct proc *);
int (*fo_close)(struct file *, struct proc *);
-/* $OpenBSD: pipe.h,v 1.27 2020/06/29 18:23:18 anton Exp $ */
+/* $OpenBSD: pipe.h,v 1.28 2022/06/20 01:39:44 visa Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
#define PIPE_WANTR 0x008 /* Reader wants some characters. */
#define PIPE_WANTW 0x010 /* Writer wants space to put characters. */
#define PIPE_WANTD 0x020 /* Pipe is wanted to be run-down. */
-#define PIPE_SEL 0x040 /* Pipe has a select active. */
#define PIPE_EOF 0x080 /* Pipe is in EOF condition. */
#define PIPE_LOCK 0x100 /* Thread has exclusive I/O access. */
#define PIPE_LWANT 0x200 /* Thread wants exclusive I/O access. */
-/* $OpenBSD: socketvar.h,v 1.102 2022/06/06 14:45:41 claudio Exp $ */
+/* $OpenBSD: socketvar.h,v 1.103 2022/06/20 01:39:44 visa Exp $ */
/* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */
/*-
int soo_read(struct file *, struct uio *, int);
int soo_write(struct file *, struct uio *, int);
int soo_ioctl(struct file *, u_long, caddr_t, struct proc *);
-int soo_poll(struct file *, int, struct proc *);
int soo_kqfilter(struct file *, struct knote *);
int soo_close(struct file *, struct proc *);
int soo_stat(struct file *, struct stat *, struct proc *);
-/* $OpenBSD: fstat.c,v 1.102 2021/07/17 20:46:02 kn Exp $ */
+/* $OpenBSD: fstat.c,v 1.103 2022/06/20 01:39:44 visa Exp $ */
/*
* Copyright (c) 2009 Todd C. Miller <millert@openbsd.org>
printf("kqueue ");
hide((void *)(uintptr_t)kf->f_data);
- printf(" %d state: %s%s\n",
+ printf(" %d state: %s\n",
kf->kq_count,
- (kf->kq_state & KQ_SEL) ? "S" : "",
(kf->kq_state & KQ_SLEEP) ? "W" : "");
return;
}