From 9183fa5be8787416fcadf672ff569613eb94518b Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 10 Jun 2006 20:00:17 +0000 Subject: [PATCH] Move selinfo stuff to the separate header sys/selinfo.h. Make sys/select.h POSIX compatible. Note: Modifications from the original patch. For the moment maintain compatibility with BSD manual pages by ensuring that the prototype for the select() function is declared in both sys/select.h and unistd.h. Submitted-by: Alexey Slynko --- include/unistd.h | 7 ++- sys/bus/firewire/firewirereg.h | 4 +- sys/bus/pccard/slot.h | 4 +- sys/dev/misc/mse/mse.c | 4 +- sys/dev/misc/psm/psm.c | 4 +- sys/dev/misc/syscons/apm/apm_saver.c | 4 +- sys/dev/misc/tw/tw.c | 4 +- sys/dev/raid/aac/aacvar.h | 6 +-- sys/dev/video/bktr/bktr_i2c.c | 4 +- sys/i386/acpica5/acpi_machdep.c | 4 +- sys/i386/apm/apm.c | 4 +- sys/i386/isa/asc.c | 4 +- sys/kern/kern_random.c | 4 +- sys/net/bpfdesc.h | 4 +- sys/net/i4b/layer4/i4b_i4bdrv.c | 4 +- sys/platform/pc32/acpica5/acpi_machdep.c | 4 +- sys/platform/pc32/apm/apm.c | 4 +- sys/platform/pc32/isa/asc.c | 4 +- sys/sys/eventvar.h | 6 +-- sys/sys/pipe.h | 6 +-- sys/sys/select.h | 57 +++++++++++++++--------- sys/sys/{select.h => selinfo.h} | 20 ++++----- sys/sys/socketvar.h | 6 +-- sys/sys/tty.h | 6 +-- sys/sys/types.h | 34 +++----------- sys/sys/vnode.h | 6 +-- 26 files changed, 102 insertions(+), 116 deletions(-) copy sys/sys/{select.h => selinfo.h} (86%) diff --git a/include/unistd.h b/include/unistd.h index 376ea19544..e24930671d 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -32,7 +32,7 @@ * * @(#)unistd.h 8.12 (Berkeley) 4/27/95 * $FreeBSD: src/include/unistd.h,v 1.35.2.10 2002/04/15 12:52:28 nectar Exp $ - * $DragonFly: src/include/unistd.h,v 1.14 2005/11/19 22:26:54 swildner Exp $ + * $DragonFly: src/include/unistd.h,v 1.15 2006/06/10 20:00:09 dillon Exp $ */ #ifndef _UNISTD_H_ @@ -184,7 +184,10 @@ int rresvport(int *); int rresvport_af(int *, int); int ruserok(const char *, int, const char *, const char *); void *sbrk(intptr_t); -int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); +#ifndef _SYS_SELECT_H_ /* bleh BSD compatibility */ +int select(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, struct timeval * __restrict); +#endif int setdomainname(const char *, int); int setegid(gid_t); int seteuid(uid_t); diff --git a/sys/bus/firewire/firewirereg.h b/sys/bus/firewire/firewirereg.h index 3d64bdc182..cf524743ef 100644 --- a/sys/bus/firewire/firewirereg.h +++ b/sys/bus/firewire/firewirereg.h @@ -32,7 +32,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/dev/firewire/firewirereg.h,v 1.33 2004/01/06 14:30:46 simokawa Exp $ - * $DragonFly: src/sys/bus/firewire/firewirereg.h,v 1.9 2006/02/17 19:17:44 dillon Exp $ + * $DragonFly: src/sys/bus/firewire/firewirereg.h,v 1.10 2006/06/10 20:00:12 dillon Exp $ * */ @@ -44,7 +44,7 @@ typedef struct thread fw_proc; typedef struct proc fw_proc; #endif -#include +#include #include struct fw_device{ diff --git a/sys/bus/pccard/slot.h b/sys/bus/pccard/slot.h index 8d90d68c3f..f29ac2fb66 100644 --- a/sys/bus/pccard/slot.h +++ b/sys/bus/pccard/slot.h @@ -33,7 +33,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/pccard/slot.h,v 1.25.2.5 2002/09/22 20:26:58 imp Exp $ - * $DragonFly: src/sys/bus/pccard/Attic/slot.h,v 1.4 2004/09/18 19:42:12 dillon Exp $ + * $DragonFly: src/sys/bus/pccard/Attic/slot.h,v 1.5 2006/06/10 20:00:14 dillon Exp $ */ #ifndef _PCCARD_SLOT_H @@ -48,7 +48,7 @@ #include #include #include -#include +#include /* * Controller data - Specific to each slot controller. diff --git a/sys/dev/misc/mse/mse.c b/sys/dev/misc/mse/mse.c index 32fccef656..4273b622c8 100644 --- a/sys/dev/misc/mse/mse.c +++ b/sys/dev/misc/mse/mse.c @@ -12,7 +12,7 @@ * without express or implied warranty. * * $FreeBSD: src/sys/i386/isa/mse.c,v 1.49.2.1 2000/03/20 13:58:47 yokota Exp $ - * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.15 2005/12/11 01:54:08 swildner Exp $ + * $DragonFly: src/sys/dev/misc/mse/mse.c,v 1.16 2006/06/10 20:00:15 dillon Exp $ */ /* * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include diff --git a/sys/dev/misc/psm/psm.c b/sys/dev/misc/psm/psm.c index e14feeefa0..dd0b7c5298 100644 --- a/sys/dev/misc/psm/psm.c +++ b/sys/dev/misc/psm/psm.c @@ -21,7 +21,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/isa/psm.c,v 1.23.2.7 2003/11/12 04:26:26 mikeh Exp $ - * $DragonFly: src/sys/dev/misc/psm/psm.c,v 1.16 2005/10/12 17:35:51 dillon Exp $ + * $DragonFly: src/sys/dev/misc/psm/psm.c,v 1.17 2006/06/10 20:00:16 dillon Exp $ */ /* @@ -75,7 +75,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sys/dev/misc/syscons/apm/apm_saver.c b/sys/dev/misc/syscons/apm/apm_saver.c index ec6b7405e0..3027011559 100644 --- a/sys/dev/misc/syscons/apm/apm_saver.c +++ b/sys/dev/misc/syscons/apm/apm_saver.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/modules/syscons/apm/apm_saver.c,v 1.1.4.2 2001/03/07 21:47:24 nsayer Exp $ - * $DragonFly: src/sys/dev/misc/syscons/apm/apm_saver.c,v 1.5 2005/02/13 03:02:25 swildner Exp $ + * $DragonFly: src/sys/dev/misc/syscons/apm/apm_saver.c,v 1.6 2006/06/10 20:00:16 dillon Exp $ */ #include @@ -40,7 +40,7 @@ #include #include "../syscons.h" -#include +#include #include #include #include diff --git a/sys/dev/misc/tw/tw.c b/sys/dev/misc/tw/tw.c index e3e5dcbd23..4f8648cdae 100644 --- a/sys/dev/misc/tw/tw.c +++ b/sys/dev/misc/tw/tw.c @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/isa/tw.c,v 1.38 2000/01/29 16:00:32 peter Exp $ - * $DragonFly: src/sys/dev/misc/tw/tw.c,v 1.15 2005/12/11 01:54:08 swildner Exp $ + * $DragonFly: src/sys/dev/misc/tw/tw.c,v 1.16 2006/06/10 20:00:16 dillon Exp $ * */ @@ -147,7 +147,7 @@ #include #include #include -#include +#include #include #include diff --git a/sys/dev/raid/aac/aacvar.h b/sys/dev/raid/aac/aacvar.h index 81a368dd4f..7d50d1678b 100644 --- a/sys/dev/raid/aac/aacvar.h +++ b/sys/dev/raid/aac/aacvar.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/aac/aacvar.h,v 1.4.2.7 2003/04/08 13:22:08 scottl Exp $ - * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.12 2006/06/04 21:09:49 dillon Exp $ + * $DragonFly: src/sys/dev/raid/aac/aacvar.h,v 1.13 2006/06/10 20:00:16 dillon Exp $ */ #include @@ -267,11 +267,7 @@ typedef struct lock aac_lock_t; #define AAC_LOCK_RELEASE(l) lockmgr(l, LK_RELEASE) #endif -#if defined(__FreeBSD__) && __FreeBSD_version >= 500005 #include -#else -#include -#endif /* * Per-controller structure. diff --git a/sys/dev/video/bktr/bktr_i2c.c b/sys/dev/video/bktr/bktr_i2c.c index a117aa6d63..d8e064beb7 100644 --- a/sys/dev/video/bktr/bktr_i2c.c +++ b/sys/dev/video/bktr/bktr_i2c.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/bktr/bktr_i2c.c,v 1.25 2003/12/08 07:59:18 obrien Exp $ - * $DragonFly: src/sys/dev/video/bktr/bktr_i2c.c,v 1.5 2004/05/15 17:54:12 joerg Exp $ + * $DragonFly: src/sys/dev/video/bktr/bktr_i2c.c,v 1.6 2006/06/10 20:00:16 dillon Exp $ */ /* @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include diff --git a/sys/i386/acpica5/acpi_machdep.c b/sys/i386/acpica5/acpi_machdep.c index 7f4e7c106e..116cb416e4 100644 --- a/sys/i386/acpica5/acpi_machdep.c +++ b/sys/i386/acpica5/acpi_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.20 2004/05/05 19:51:15 njl Exp $ - * $DragonFly: src/sys/i386/acpica5/Attic/acpi_machdep.c,v 1.7 2005/04/11 06:05:54 dillon Exp $ + * $DragonFly: src/sys/i386/acpica5/Attic/acpi_machdep.c,v 1.8 2006/06/10 20:00:17 dillon Exp $ */ #include @@ -45,7 +45,7 @@ static device_t acpi_dev; * APM driver emulation */ -#include +#include #include #include diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 213cfcef09..53f2d73c5b 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/apm/apm.c @@ -16,7 +16,7 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * * $FreeBSD: src/sys/i386/apm/apm.c,v 1.114.2.5 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/i386/apm/Attic/apm.c,v 1.13 2005/12/24 20:34:04 swildner Exp $ + * $DragonFly: src/sys/i386/apm/Attic/apm.c,v 1.14 2006/06/10 20:00:17 dillon Exp $ */ #include @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sys/i386/isa/asc.c b/sys/i386/isa/asc.c index 6118d8f387..bfe6e0e1b1 100644 --- a/sys/i386/isa/asc.c +++ b/sys/i386/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/i386/isa/Attic/asc.c,v 1.12 2006/04/30 17:22:17 dillon Exp $ + * $DragonFly: src/sys/i386/isa/Attic/asc.c,v 1.13 2006/06/10 20:00:17 dillon Exp $ */ #include "use_asc.h" @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include diff --git a/sys/kern/kern_random.c b/sys/kern/kern_random.c index ab63938e57..1dac839a54 100644 --- a/sys/kern/kern_random.c +++ b/sys/kern/kern_random.c @@ -2,7 +2,7 @@ * kern_random.c -- A strong random number generator * * $FreeBSD: src/sys/kern/kern_random.c,v 1.36.2.4 2002/09/17 17:11:57 sam Exp $ - * $DragonFly: src/sys/kern/Attic/kern_random.c,v 1.14 2006/04/12 18:28:30 dillon Exp $ + * $DragonFly: src/sys/kern/Attic/kern_random.c,v 1.15 2006/06/10 20:00:17 dillon Exp $ * * Version 0.95, last modified 18-Oct-95 * @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h index 2870ea7fcc..16b701e97b 100644 --- a/sys/net/bpfdesc.h +++ b/sys/net/bpfdesc.h @@ -38,14 +38,14 @@ * @(#)bpfdesc.h 8.1 (Berkeley) 6/10/93 * * $FreeBSD: src/sys/net/bpfdesc.h,v 1.14.2.2 2001/12/17 19:32:33 jdp Exp $ - * $DragonFly: src/sys/net/bpfdesc.h,v 1.4 2005/01/26 00:37:39 joerg Exp $ + * $DragonFly: src/sys/net/bpfdesc.h,v 1.5 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _NET_BPFDESC_H_ #define _NET_BPFDESC_H_ #include -#include +#include /* * Descriptor associated with each open bpf file. diff --git a/sys/net/i4b/layer4/i4b_i4bdrv.c b/sys/net/i4b/layer4/i4b_i4bdrv.c index 0af0d9f168..4b76117f10 100644 --- a/sys/net/i4b/layer4/i4b_i4bdrv.c +++ b/sys/net/i4b/layer4/i4b_i4bdrv.c @@ -28,7 +28,7 @@ * -------------------------------------------- * * $FreeBSD: src/sys/i4b/layer4/i4b_i4bdrv.c,v 1.11.2.5 2001/12/16 15:12:59 hm Exp $ - * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.13 2005/06/14 21:19:19 joerg Exp $ + * $DragonFly: src/sys/net/i4b/layer4/i4b_i4bdrv.c,v 1.14 2006/06/10 20:00:17 dillon Exp $ * * last edit-date: [Sat Aug 11 18:08:10 2001] * @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include diff --git a/sys/platform/pc32/acpica5/acpi_machdep.c b/sys/platform/pc32/acpica5/acpi_machdep.c index 353e57a40b..71797196be 100644 --- a/sys/platform/pc32/acpica5/acpi_machdep.c +++ b/sys/platform/pc32/acpica5/acpi_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.20 2004/05/05 19:51:15 njl Exp $ - * $DragonFly: src/sys/platform/pc32/acpica5/acpi_machdep.c,v 1.7 2005/04/11 06:05:54 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/acpi_machdep.c,v 1.8 2006/06/10 20:00:17 dillon Exp $ */ #include @@ -45,7 +45,7 @@ static device_t acpi_dev; * APM driver emulation */ -#include +#include #include #include diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c index d8e0704e13..0d89c01b89 100644 --- a/sys/platform/pc32/apm/apm.c +++ b/sys/platform/pc32/apm/apm.c @@ -16,7 +16,7 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * * $FreeBSD: src/sys/i386/apm/apm.c,v 1.114.2.5 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.13 2005/12/24 20:34:04 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.14 2006/06/10 20:00:17 dillon Exp $ */ #include @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c index 71c1cf8d35..b498f179f2 100644 --- a/sys/platform/pc32/isa/asc.c +++ b/sys/platform/pc32/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.12 2006/04/30 17:22:17 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.13 2006/06/10 20:00:17 dillon Exp $ */ #include "use_asc.h" @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include diff --git a/sys/sys/eventvar.h b/sys/sys/eventvar.h index 85cc751b1e..73e52c7b96 100644 --- a/sys/sys/eventvar.h +++ b/sys/sys/eventvar.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/eventvar.h,v 1.1.2.2 2000/07/18 21:49:12 jlemon Exp $ - * $DragonFly: src/sys/sys/eventvar.h,v 1.5 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/eventvar.h,v 1.6 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_EVENTVAR_H_ @@ -42,8 +42,8 @@ #ifndef _SYS_EVENT_H_ #include #endif -#ifndef _SYS_SELECT_H_ -#include +#ifndef _SYS_SELINFO_H_ +#include #endif diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index c78257d043..4239aa4fa7 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -19,7 +19,7 @@ * are met. * * $FreeBSD: src/sys/sys/pipe.h,v 1.16 1999/12/29 04:24:45 peter Exp $ - * $DragonFly: src/sys/sys/pipe.h,v 1.9 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/pipe.h,v 1.10 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_PIPE_H_ @@ -33,8 +33,8 @@ #ifndef _SYS_TIME_H_ #include /* for struct timespec */ #endif -#ifndef _SYS_SELECT_H_ -#include /* for struct selinfo */ +#ifndef _SYS_SELINFO_H_ +#include /* for struct selinfo */ #endif #ifndef _SYS_XIO_H_ #include /* for struct xio */ diff --git a/sys/sys/select.h b/sys/sys/select.h index 170776933c..856fdc4261 100644 --- a/sys/sys/select.h +++ b/sys/sys/select.h @@ -32,39 +32,54 @@ * * @(#)select.h 8.2 (Berkeley) 1/4/94 * $FreeBSD: src/sys/sys/select.h,v 1.6.2.1 2000/05/05 03:50:02 jlemon Exp $ - * $DragonFly: src/sys/sys/select.h,v 1.6 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/select.h,v 1.7 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_SELECT_H_ #define _SYS_SELECT_H_ -#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) - -#ifndef _SYS_EVENT_H_ -#include /* for struct klist */ +#ifndef _SYS_SIGNAL_H_ +#include #endif -#ifndef _SYS_NETISR_H_ -#include /* for struct notifymsglist */ +#ifndef _SYS_TIME_H_ +#include #endif /* - * Used to maintain information about processes that wish to be - * notified when I/O becomes possible. + * Select uses bit masks of file descriptors in longs. These macros + * manipulate such bit fields (the filesystem macros use chars). + * FD_SETSIZE may be defined by the user, but the default here should + * be enough for most uses. */ -struct selinfo { - pid_t si_pid; /* process to be notified */ - struct klist si_note; /* kernel note list */ - struct notifymsglist si_mlist; /* list of pending predicate messages */ - short si_flags; /* see below */ -}; -#define SI_COLL 0x0001 /* collision occurred */ +#ifndef FD_SETSIZE +#define FD_SETSIZE 1024 +#endif + +#ifndef NBBY +#define NBBY 8 +#endif + +typedef unsigned long fd_mask; +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ + +#ifndef howmany +#define howmany(x, y) (((x) + ((y) - 1)) / (y)) +#endif + +typedef struct fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} fd_set; -#ifdef _KERNEL -struct thread; +#define _fdset_mask(n) ((fd_mask)1 << ((n) % NFDBITS)) +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= _fdset_mask(n)) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~_fdset_mask(n)) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & _fdset_mask(n)) +#define FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) +#define FD_ZERO(p) bzero(p, sizeof(*(p))) -void selrecord (struct thread *selector, struct selinfo *); -void selwakeup (struct selinfo *); +#ifndef _UNISTD_H_ +int select(int, fd_set * __restrict, fd_set * __restrict, + fd_set * __restrict, struct timeval * __restrict); #endif -#endif /* _KERNEL || _KERNEL_STRUCTURES */ #endif /* !_SYS_SELECT_H_ */ diff --git a/sys/sys/select.h b/sys/sys/selinfo.h similarity index 86% copy from sys/sys/select.h copy to sys/sys/selinfo.h index 170776933c..432b823171 100644 --- a/sys/sys/select.h +++ b/sys/sys/selinfo.h @@ -30,22 +30,19 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)select.h 8.2 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/sys/select.h,v 1.6.2.1 2000/05/05 03:50:02 jlemon Exp $ - * $DragonFly: src/sys/sys/select.h,v 1.6 2006/05/21 03:43:47 dillon Exp $ + * @(#)selinfo.h 8.2 (Berkeley) 1/4/94 + * $DragonFly: src/sys/sys/selinfo.h,v 1.1 2006/06/10 20:00:17 dillon Exp $ */ -#ifndef _SYS_SELECT_H_ -#define _SYS_SELECT_H_ +#ifndef _SYS_SELINFO_H_ +#define _SYS_SELINFO_H_ #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) -#ifndef _SYS_EVENT_H_ +#include + #include /* for struct klist */ -#endif -#ifndef _SYS_NETISR_H_ #include /* for struct notifymsglist */ -#endif /* * Used to maintain information about processes that wish to be @@ -59,12 +56,11 @@ struct selinfo { }; #define SI_COLL 0x0001 /* collision occurred */ -#ifdef _KERNEL struct thread; void selrecord (struct thread *selector, struct selinfo *); void selwakeup (struct selinfo *); + #endif -#endif /* _KERNEL || _KERNEL_STRUCTURES */ -#endif /* !_SYS_SELECT_H_ */ +#endif /* !_SYS_SELINFO_H_ */ diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 98c3b34349..7b0a9fdb91 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -32,7 +32,7 @@ * * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/socketvar.h,v 1.46.2.10 2003/08/24 08:24:39 hsu Exp $ - * $DragonFly: src/sys/sys/socketvar.h,v 1.24 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/socketvar.h,v 1.25 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_SOCKETVAR_H_ @@ -44,8 +44,8 @@ #ifndef _SYS_QUEUE_H_ #include /* for TAILQ macros */ #endif -#ifndef _SYS_SELECT_H_ -#include /* for struct selinfo */ +#ifndef _SYS_SELINFO_H_ +#include /* for struct selinfo */ #endif #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES) diff --git a/sys/sys/tty.h b/sys/sys/tty.h index d7c9ca1d4a..16cdc44e0a 100644 --- a/sys/sys/tty.h +++ b/sys/sys/tty.h @@ -37,7 +37,7 @@ * * @(#)tty.h 8.6 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/tty.h,v 1.53.2.1 2001/02/26 04:23:21 jlemon Exp $ - * $DragonFly: src/sys/sys/tty.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/tty.h,v 1.9 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_TTY_H_ @@ -46,8 +46,8 @@ #ifndef _SYS_TERMIOS_H_ #include #endif -#ifndef _SYS_SELECT_H_ -#include /* For struct selinfo. */ +#ifndef _SYS_SELINFO_H_ +#include #endif /* diff --git a/sys/sys/types.h b/sys/sys/types.h index 78559775b6..5d97d99c5c 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -37,7 +37,7 @@ * * @(#)types.h 8.6 (Berkeley) 2/19/95 * $FreeBSD: src/sys/sys/types.h,v 1.40.2.2 2001/04/21 14:53:06 ume Exp $ - * $DragonFly: src/sys/sys/types.h,v 1.13 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/types.h,v 1.14 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_TYPES_H_ @@ -181,37 +181,13 @@ typedef __time_t time_t; typedef __timer_t timer_t; #endif -#ifndef _POSIX_SOURCE -#define NBBY 8 /* number of bits in a byte */ - -/* - * Select uses bit masks of file descriptors in longs. These macros - * manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here should - * be enough for most uses. - */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 1024 +#ifndef _SYS_SELECT_H_ +#include #endif -typedef unsigned long fd_mask; -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ - -#ifndef howmany -#define howmany(x, y) (((x) + ((y) - 1)) / (y)) -#endif - -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; - -#define _fdset_mask(n) ((fd_mask)1 << ((n) % NFDBITS)) -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= _fdset_mask(n)) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~_fdset_mask(n)) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & _fdset_mask(n)) -#define FD_COPY(f, t) bcopy(f, t, sizeof(*(f))) -#define FD_ZERO(p) bzero(p, sizeof(*(p))) +#ifndef _POSIX_SOURCE +#define NBBY 8 /* number of bits in a byte */ /* * These declarations belong elsewhere, but are repeated here and in * to give broken programs a better chance of working with diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 21c5e03381..52cebced74 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -32,7 +32,7 @@ * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 * $FreeBSD: src/sys/sys/vnode.h,v 1.111.2.19 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/sys/vnode.h,v 1.59 2006/06/02 04:59:53 dillon Exp $ + * $DragonFly: src/sys/sys/vnode.h,v 1.60 2006/06/10 20:00:17 dillon Exp $ */ #ifndef _SYS_VNODE_H_ @@ -46,8 +46,8 @@ #ifndef _SYS_LOCK_H_ #include #endif -#ifndef _SYS_SELECT_H_ -#include +#ifndef _SYS_SELINFO_H_ +#include #endif #ifndef _SYS_BIOTRACK_H_ #include -- 2.41.0