DragonFly BSD
DragonFly submit List (threaded) for 2006-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

sys/select.h patch


From: Alexey Slynko <slynko@xxxxxxxxx>
Date: Thu, 08 Jun 2006 20:48:27 +0400

Hi,

features of this patch ;)

1) Make sys/select.h POSIX compatible
2) Move selinfo stuff to the separate header sys/selinfo.h
3) Fix namespace pollution in games/larn

In fact, select() moved from unistd.h to sys/select.h,
and also fd_set struct and FD_* macros moved from sys/types.h to
sys/select.h, as it required by
http://www.opengroup.org/onlinepubs/009695399/functions/pselect.html

It's a preparation for the further pselect work, requested at project
page http://wiki.dragonflybsd.org/index.cgi/Projects_Page

Index: games/larn/monster.c
===================================================================
RCS file: /home/dragonfly/cvs/src/games/larn/monster.c,v
retrieving revision 1.2
diff -u -r1.2 monster.c
--- games/larn/monster.c	17 Jun 2003 04:25:24 -0000	1.2
+++ games/larn/monster.c	8 Jun 2006 14:54:05 -0000
@@ -447,7 +447,7 @@
 					free((char*)save);	 positionplayer();  return;
 					}
 
-		case 37:	/* permanence */ adjtime(-99999L);  spelknow[37]=0; /* forget */
+		case 37:	/* permanence */ _adjtime(-99999L);  spelknow[37]=0; /* forget */
 					loseint();
 					return;
 
Index: games/larn/object.c
===================================================================
RCS file: /home/dragonfly/cvs/src/games/larn/object.c,v
retrieving revision 1.3
diff -u -r1.3 object.c
--- games/larn/object.c	22 Jan 2006 03:43:37 -0000	1.3
+++ games/larn/object.c	8 Jun 2006 11:53:25 -0000
@@ -534,7 +534,7 @@
 /*
  *	function to adjust time when time warping and taking courses in school
  */
-adjtime(tim)
+_adjtime(tim)
 	long tim;
 	{
 	int j;
@@ -576,7 +576,7 @@
 	  case 7:	gtime += (i = rnd(1000) - 850); /* time warp */
 				if (i>=0) lprintf("\nYou went forward in time by %d mobuls",(long)((i+99)/100));
 				else lprintf("\nYou went backward in time by %d mobuls",(long)(-(i+99)/100));
-				adjtime((long)i);	/* adjust time for time warping */
+				_adjtime((long)i);	/* adjust time for time warping */
 				return;
 
 	  case 8:	oteleport(0);	  return;	/*	teleportation */
Index: games/larn/store.c
===================================================================
RCS file: /home/dragonfly/cvs/src/games/larn/store.c,v
retrieving revision 1.2
diff -u -r1.2 store.c
--- games/larn/store.c	17 Jun 2003 04:25:24 -0000	1.2
+++ games/larn/store.c	8 Jun 2006 15:00:16 -0000
@@ -392,7 +392,7 @@
 
 			  if (c[BLINDCOUNT])	c[BLINDCOUNT]=1;  /* cure blindness too!  */
 			  if (c[CONFUSE])		c[CONFUSE]=1;	/*	end confusion	*/
-			  adjtime((long)time_used);	/* adjust parameters for time change */
+			  _adjtime((long)time_used);	/* adjust parameters for time change */
 			  }
 			nap(1000);
 			}
Index: include/unistd.h
===================================================================
RCS file: /home/dragonfly/cvs/src/include/unistd.h,v
retrieving revision 1.14
diff -u -r1.14 unistd.h
--- include/unistd.h	19 Nov 2005 22:26:54 -0000	1.14
+++ include/unistd.h	13 Apr 2006 01:04:30 -0000
@@ -114,9 +114,6 @@
 int	 getopt(int, char * const [], const char *);
 
 #ifndef	_POSIX_SOURCE
-#ifdef	__STDC__
-struct timeval;				/* select(2) */
-#endif
 int	 acct(const char *);
 int	 async_daemon (void);
 int	 brk(const void *);
@@ -184,7 +181,6 @@
 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 *);
 int	 setdomainname(const char *, int);
 int	 setegid(gid_t);
 int	 seteuid(uid_t);
Index: sys/bus/firewire/firewirereg.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/bus/firewire/firewirereg.h,v
retrieving revision 1.9
diff -u -r1.9 firewirereg.h
--- sys/bus/firewire/firewirereg.h	17 Feb 2006 19:17:44 -0000	1.9
+++ sys/bus/firewire/firewirereg.h	20 Apr 2006 22:14:44 -0000
@@ -44,7 +44,7 @@
 typedef	struct proc fw_proc;
 #endif
 
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/uio.h>
 
 struct fw_device{
Index: sys/bus/pccard/slot.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/bus/pccard/slot.h,v
retrieving revision 1.4
diff -u -r1.4 slot.h
--- sys/bus/pccard/slot.h	18 Sep 2004 19:42:12 -0000	1.4
+++ sys/bus/pccard/slot.h	20 Apr 2006 22:15:05 -0000
@@ -48,7 +48,7 @@
 #include <machine/bus.h>
 #include <sys/rman.h>
 #include <machine/resource.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 
 /*
  *	Controller data - Specific to each slot controller.
Index: sys/dev/misc/mse/mse.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/misc/mse/mse.c,v
retrieving revision 1.15
diff -u -r1.15 mse.c
--- sys/dev/misc/mse/mse.c	11 Dec 2005 01:54:08 -0000	1.15
+++ sys/dev/misc/mse/mse.c	24 Apr 2006 20:48:38 -0000
@@ -51,7 +51,7 @@
 #include <sys/kernel.h>
 #include <sys/bus.h>
 #include <sys/poll.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/thread2.h>
 #include <sys/uio.h>
 
Index: sys/dev/misc/psm/psm.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/misc/psm/psm.c,v
retrieving revision 1.16
diff -u -r1.16 psm.c
--- sys/dev/misc/psm/psm.c	12 Oct 2005 17:35:51 -0000	1.16
+++ sys/dev/misc/psm/psm.c	24 Apr 2006 20:59:16 -0000
@@ -75,7 +75,7 @@
 #include <sys/malloc.h>
 #include <machine/bus.h>
 #include <sys/rman.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/thread2.h>
 #include <sys/time.h>
 #include <sys/uio.h>
Index: sys/dev/misc/syscons/apm/apm_saver.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/misc/syscons/apm/apm_saver.c,v
retrieving revision 1.5
diff -u -r1.5 apm_saver.c
--- sys/dev/misc/syscons/apm/apm_saver.c	13 Feb 2005 03:02:25 -0000	1.5
+++ sys/dev/misc/syscons/apm/apm_saver.c	24 Apr 2006 21:10:51 -0000
@@ -40,7 +40,7 @@
 #include <dev/video/fb/splashreg.h>
 #include "../syscons.h"
 
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <machine/apm_bios.h>
 #include <machine/pc/bios.h>
 #include <i386/apm/apm.h>
Index: sys/dev/misc/tw/tw.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/misc/tw/tw.c,v
retrieving revision 1.15
diff -u -r1.15 tw.c
--- sys/dev/misc/tw/tw.c	11 Dec 2005 01:54:08 -0000	1.15
+++ sys/dev/misc/tw/tw.c	24 Apr 2006 20:55:08 -0000
@@ -147,7 +147,7 @@
 #include <sys/kernel.h>
 #include <sys/uio.h>
 #include <sys/syslog.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/poll.h>
 #include <sys/thread2.h>
 
Index: sys/dev/raid/aac/aacvar.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/raid/aac/aacvar.h,v
retrieving revision 1.12
diff -u -r1.12 aacvar.h
--- sys/dev/raid/aac/aacvar.h	4 Jun 2006 21:09:49 -0000	1.12
+++ sys/dev/raid/aac/aacvar.h	5 Jun 2006 22:19:37 -0000
@@ -267,11 +267,7 @@
 #define AAC_LOCK_RELEASE(l)	lockmgr(l, LK_RELEASE)
 #endif
 
-#if defined(__FreeBSD__) && __FreeBSD_version >= 500005
 #include <sys/selinfo.h>
-#else
-#include <sys/select.h>
-#endif
 
 /*
  * Per-controller structure.
Index: sys/dev/video/bktr/bktr_i2c.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/dev/video/bktr/bktr_i2c.c,v
retrieving revision 1.5
diff -u -r1.5 bktr_i2c.c
--- sys/dev/video/bktr/bktr_i2c.c	15 May 2004 17:54:12 -0000	1.5
+++ sys/dev/video/bktr/bktr_i2c.c	24 Apr 2006 17:31:27 -0000
@@ -43,7 +43,7 @@
 #include <sys/bus.h>
 #include <sys/uio.h>
 
-#include <sys/select.h>
+#include <sys/selinfo.h>
 
 #include <bus/pci/pcivar.h>
 #include <bus/pci/pcireg.h>
Index: sys/i386/acpica5/acpi_machdep.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/i386/acpica5/acpi_machdep.c,v
retrieving revision 1.7
diff -u -r1.7 acpi_machdep.c
--- sys/i386/acpica5/acpi_machdep.c	11 Apr 2005 06:05:54 -0000	1.7
+++ sys/i386/acpica5/acpi_machdep.c	24 Apr 2006 17:36:11 -0000
@@ -45,7 +45,7 @@
  * APM driver emulation 
  */
 
-#include <sys/select.h>
+#include <sys/selinfo.h>
 
 #include <machine/apm_bios.h>
 #include <machine/pc/bios.h>
Index: sys/i386/apm/apm.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/i386/apm/apm.c,v
retrieving revision 1.13
diff -u -r1.13 apm.c
--- sys/i386/apm/apm.c	24 Dec 2005 20:34:04 -0000	1.13
+++ sys/i386/apm/apm.c	24 Apr 2006 17:37:35 -0000
@@ -27,7 +27,7 @@
 #include <sys/time.h>
 #include <sys/reboot.h>
 #include <sys/bus.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/poll.h>
 #include <sys/fcntl.h>
 #include <sys/uio.h>
Index: sys/i386/isa/asc.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/i386/isa/asc.c,v
retrieving revision 1.12
diff -u -r1.12 asc.c
--- sys/i386/isa/asc.c	30 Apr 2006 17:22:17 -0000	1.12
+++ sys/i386/isa/asc.c	12 May 2006 10:43:36 -0000
@@ -47,7 +47,7 @@
 #include <sys/malloc.h>
 #include <sys/kernel.h>
 #include <sys/poll.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/uio.h>
 #include <sys/thread2.h>
 
Index: sys/kern/kern_random.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/kern/kern_random.c,v
retrieving revision 1.14
diff -u -r1.14 kern_random.c
--- sys/kern/kern_random.c	12 Apr 2006 18:28:30 -0000	1.14
+++ sys/kern/kern_random.c	26 May 2006 11:29:45 -0000
@@ -45,7 +45,7 @@
 #include <sys/md5.h>
 #include <sys/poll.h>
 #include <sys/random.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 #include <sys/systm.h>
 #include <sys/systimer.h>
 #include <sys/thread2.h>
Index: sys/net/bpfdesc.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/net/bpfdesc.h,v
retrieving revision 1.4
diff -u -r1.4 bpfdesc.h
--- sys/net/bpfdesc.h	26 Jan 2005 00:37:39 -0000	1.4
+++ sys/net/bpfdesc.h	20 Apr 2006 23:05:40 -0000
@@ -45,7 +45,7 @@
 #define _NET_BPFDESC_H_
 
 #include <sys/callout.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 
 /*
  * Descriptor associated with each open bpf file.
Index: sys/net/i4b/layer4/i4b_i4bdrv.c
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/net/i4b/layer4/i4b_i4bdrv.c,v
retrieving revision 1.13
diff -u -r1.13 i4b_i4bdrv.c
--- sys/net/i4b/layer4/i4b_i4bdrv.c	14 Jun 2005 21:19:19 -0000	1.13
+++ sys/net/i4b/layer4/i4b_i4bdrv.c	20 Apr 2006 23:16:27 -0000
@@ -55,7 +55,7 @@
 #include <sys/mbuf.h>
 #include <sys/socket.h>
 #include <sys/thread2.h>
-#include <sys/select.h>
+#include <sys/selinfo.h>
 
 #include <net/if.h>
 
Index: sys/sys/eventvar.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/eventvar.h,v
retrieving revision 1.5
diff -u -r1.5 eventvar.h
--- sys/sys/eventvar.h	21 May 2006 03:43:47 -0000	1.5
+++ sys/sys/eventvar.h	26 May 2006 11:28:02 -0000
@@ -42,8 +42,8 @@
 #ifndef _SYS_EVENT_H_
 #include <sys/event.h>
 #endif
-#ifndef _SYS_SELECT_H_
-#include <sys/select.h>
+#ifndef _SYS_SELINFO_H_
+#include <sys/selinfo.h>
 #endif
 
 
Index: sys/sys/pipe.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/pipe.h,v
retrieving revision 1.9
diff -u -r1.9 pipe.h
--- sys/sys/pipe.h	21 May 2006 03:43:47 -0000	1.9
+++ sys/sys/pipe.h	22 May 2006 10:00:31 -0000
@@ -33,8 +33,8 @@
 #ifndef _SYS_TIME_H_
 #include <sys/time.h>			/* for struct timespec */
 #endif
-#ifndef _SYS_SELECT_H_
-#include <sys/select.h>			/* for struct selinfo */
+#ifndef _SYS_SELINFO_H_
+#include <sys/selinfo.h>		/* for struct selinfo */
 #endif
 #ifndef _SYS_XIO_H_
 #include <sys/xio.h>			/* for struct xio */
Index: sys/sys/select.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/select.h,v
retrieving revision 1.6
diff -u -r1.6 select.h
--- sys/sys/select.h	21 May 2006 03:43:47 -0000	1.6
+++ sys/sys/select.h	8 Jun 2006 10:33:22 -0000
@@ -38,33 +38,46 @@
 #ifndef _SYS_SELECT_H_
 #define	_SYS_SELECT_H_
 
-#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
-
-#ifndef _SYS_EVENT_H_
-#include <sys/event.h>			/* for struct klist */
+#ifndef _SYS_SIGNAL_H_
+#include <sys/signal.h>
 #endif
-#ifndef _SYS_NETISR_H_
-#include <net/netisr.h>			/* for struct notifymsglist */
+#ifndef _SYS_TIME_H_
+#include <sys/time.h>
 #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
 
-#ifdef _KERNEL
-struct thread;
+typedef unsigned long   fd_mask;
+#define NFDBITS (sizeof(fd_mask) * NBBY)	/* bits per mask */
 
-void	selrecord (struct thread *selector, struct selinfo *);
-void	selwakeup (struct selinfo *);
+#ifndef howmany
+#define howmany(x, y)	(((x) + ((y) - 1)) / (y))
 #endif
 
-#endif	/* _KERNEL || _KERNEL_STRUCTURES */
+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)))
+
+int	select(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict,
+               struct timeval * __restrict);
+
 #endif	/* !_SYS_SELECT_H_ */
Index: sys/sys/selinfo.h
===================================================================
RCS file: sys/sys/selinfo.h
diff -N sys/sys/selinfo.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sys/sys/selinfo.h	8 Jun 2006 19:07:58 -0000
@@ -0,0 +1,65 @@
+/*-
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)selinfo.h	8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _SYS_SELINFO_H_
+#define	_SYS_SELINFO_H_
+
+#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
+
+#include <sys/signal.h>
+
+#include <sys/event.h>			/* for struct klist */
+#include <net/netisr.h>			/* for struct notifymsglist */
+
+/*
+ * Used to maintain information about processes that wish to be
+ * notified when I/O becomes possible.
+ */
+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 */
+
+struct thread;
+
+void	selrecord (struct thread *selector, struct selinfo *);
+void	selwakeup (struct selinfo *);
+
+#endif
+
+#endif /* !_SYS_SELINFO_H_ */
Index: sys/sys/socketvar.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/socketvar.h,v
retrieving revision 1.24
diff -u -r1.24 socketvar.h
--- sys/sys/socketvar.h	21 May 2006 03:43:47 -0000	1.24
+++ sys/sys/socketvar.h	22 May 2006 10:07:05 -0000
@@ -44,8 +44,8 @@
 #ifndef _SYS_QUEUE_H_
 #include <sys/queue.h>			/* for TAILQ macros */
 #endif
-#ifndef _SYS_SELECT_H_
-#include <sys/select.h>			/* for struct selinfo */
+#ifndef _SYS_SELINFO_H_
+#include <sys/selinfo.h>		/* for struct selinfo */
 #endif
 
 #if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
Index: sys/sys/tty.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/tty.h,v
retrieving revision 1.8
diff -u -r1.8 tty.h
--- sys/sys/tty.h	21 May 2006 03:43:47 -0000	1.8
+++ sys/sys/tty.h	22 May 2006 09:58:40 -0000
@@ -46,8 +46,8 @@
 #ifndef _SYS_TERMIOS_H_
 #include <sys/termios.h>
 #endif
-#ifndef _SYS_SELECT_H_
-#include <sys/select.h>		/* For struct selinfo. */
+#ifndef _SYS_SELINFO_H_
+#include <sys/selinfo.h>
 #endif
 
 /*
Index: sys/sys/types.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/types.h,v
retrieving revision 1.13
diff -u -r1.13 types.h
--- sys/sys/types.h	21 May 2006 03:43:47 -0000	1.13
+++ sys/sys/types.h	8 Jun 2006 12:28:09 -0000
@@ -181,37 +181,13 @@
 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 <sys/select.h>
 #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
  * <stdio.h> to give broken programs a better chance of working with
Index: sys/sys/vnode.h
===================================================================
RCS file: /home/dragonfly/cvs/src/sys/sys/vnode.h,v
retrieving revision 1.59
diff -u -r1.59 vnode.h
--- sys/sys/vnode.h	2 Jun 2006 04:59:53 -0000	1.59
+++ sys/sys/vnode.h	5 Jun 2006 22:19:56 -0000
@@ -46,8 +46,8 @@
 #ifndef _SYS_LOCK_H_
 #include <sys/lock.h>
 #endif
-#ifndef _SYS_SELECT_H_
-#include <sys/select.h>
+#ifndef _SYS_SELINFO_H_
+#include <sys/selinfo.h>
 #endif
 #ifndef _SYS_BIOTRACK_H_
 #include <sys/biotrack.h>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]