diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-09-23 16:51:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-09-23 16:51:15 +0000 |
commit | 6bb276a1685d8546283d224a3d249c66cc329264 (patch) | |
tree | 5e1c80d6cad38a8a82f5832e1e315103e7029eb9 /sys/adosfs/advnops.c | |
parent | 96675671ec2520ade2f83b31563ab4da72bd443d (diff) |
Replace select backends with poll backends. selscan() and pollscan()
now call the poll backend. With this change we implement greater
poll(2) functionality instead of emulating it via the select backend.
Adapted from NetBSD and including some changes from FreeBSD.
Tested by many, deraadt@ OK
Diffstat (limited to 'sys/adosfs/advnops.c')
-rw-r--r-- | sys/adosfs/advnops.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/adosfs/advnops.c b/sys/adosfs/advnops.c index e02a102e27c..a6b8350d464 100644 --- a/sys/adosfs/advnops.c +++ b/sys/adosfs/advnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: advnops.c,v 1.25 2003/07/24 22:00:24 mickey Exp $ */ +/* $OpenBSD: advnops.c,v 1.26 2003/09/23 16:51:11 millert Exp $ */ /* $NetBSD: advnops.c,v 1.32 1996/10/13 02:52:09 christos Exp $ */ /* @@ -44,6 +44,7 @@ #include <sys/malloc.h> #include <sys/stat.h> #include <sys/unistd.h> +#include <sys/poll.h> #include <sys/proc.h> #include <machine/endian.h> @@ -57,7 +58,7 @@ int adosfs_getattr(void *); int adosfs_read(void *); int adosfs_write(void *); int adosfs_ioctl(void *); -int adosfs_select(void *); +int adosfs_poll(void *); int adosfs_strategy(void *); int adosfs_link(void *); int adosfs_symlink(void *); @@ -107,7 +108,7 @@ struct vnodeopv_entry_desc adosfs_vnodeop_entries[] = { { &vop_write_desc, adosfs_write }, /* write */ { &vop_lease_desc, adosfs_lease_check }, /* lease */ { &vop_ioctl_desc, adosfs_ioctl }, /* ioctl */ - { &vop_select_desc, adosfs_select }, /* select */ + { &vop_poll_desc, adosfs_poll }, /* poll */ { &vop_fsync_desc, adosfs_fsync }, /* fsync */ { &vop_remove_desc, adosfs_remove }, /* remove */ { &vop_link_desc, adosfs_link }, /* link */ @@ -376,24 +377,23 @@ adosfs_ioctl(v) /* ARGSUSED */ int -adosfs_select(v) +adosfs_poll(v) void *v; { -#ifdef ADOSFS_DIAGNOSTIC - struct vop_select_args /* { + struct vop_poll_args /* { struct vnode *a_vp; - int a_which; - int a_fflags; - struct ucred *a_cred; + int a_events; struct proc *a_p; } */ *sp = v; +#ifdef ADOSFS_DIAGNOSTIC /* * sure there's something to read... */ advopprint(sp); - printf(" 1)"); + printf(" %d", + ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); #endif - return(1); + return(ap->a_events & (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)); } /* |