select.patch

slynko, 06/08/2006 04:55 PM

Download (19.4 KB)

View differences:

games/larn/monster.c 8 Jun 2006 14:54:05 -0000
447 447
					free((char*)save);	 positionplayer();  return;
448 448
					}
449 449

  
450
		case 37:	/* permanence */ adjtime(-99999L);  spelknow[37]=0; /* forget */
450
		case 37:	/* permanence */ _adjtime(-99999L);  spelknow[37]=0; /* forget */
451 451
					loseint();
452 452
					return;
453 453

  
games/larn/object.c 8 Jun 2006 11:53:25 -0000
534 534
/*
535 535
 *	function to adjust time when time warping and taking courses in school
536 536
 */
537
adjtime(tim)
537
_adjtime(tim)
538 538
	long tim;
539 539
	{
540 540
	int j;
......
576 576
	  case 7:	gtime += (i = rnd(1000) - 850); /* time warp */
577 577
				if (i>=0) lprintf("\nYou went forward in time by %d mobuls",(long)((i+99)/100));
578 578
				else lprintf("\nYou went backward in time by %d mobuls",(long)(-(i+99)/100));
579
				adjtime((long)i);	/* adjust time for time warping */
579
				_adjtime((long)i);	/* adjust time for time warping */
580 580
				return;
581 581

  
582 582
	  case 8:	oteleport(0);	  return;	/*	teleportation */
games/larn/store.c 8 Jun 2006 15:00:16 -0000
392 392

  
393 393
			  if (c[BLINDCOUNT])	c[BLINDCOUNT]=1;  /* cure blindness too!  */
394 394
			  if (c[CONFUSE])		c[CONFUSE]=1;	/*	end confusion	*/
395
			  adjtime((long)time_used);	/* adjust parameters for time change */
395
			  _adjtime((long)time_used);	/* adjust parameters for time change */
396 396
			  }
397 397
			nap(1000);
398 398
			}
include/unistd.h 13 Apr 2006 01:04:30 -0000
114 114
int	 getopt(int, char * const [], const char *);
115 115

  
116 116
#ifndef	_POSIX_SOURCE
117
#ifdef	__STDC__
118
struct timeval;				/* select(2) */
119
#endif
120 117
int	 acct(const char *);
121 118
int	 async_daemon (void);
122 119
int	 brk(const void *);
......
184 181
int	 rresvport_af(int *, int);
185 182
int	 ruserok(const char *, int, const char *, const char *);
186 183
void	*sbrk(intptr_t);
187
int	 select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
188 184
int	 setdomainname(const char *, int);
189 185
int	 setegid(gid_t);
190 186
int	 seteuid(uid_t);
sys/bus/firewire/firewirereg.h 20 Apr 2006 22:14:44 -0000
44 44
typedef	struct proc fw_proc;
45 45
#endif
46 46

  
47
#include <sys/select.h>
47
#include <sys/selinfo.h>
48 48
#include <sys/uio.h>
49 49

  
50 50
struct fw_device{
sys/bus/pccard/slot.h 20 Apr 2006 22:15:05 -0000
48 48
#include <machine/bus.h>
49 49
#include <sys/rman.h>
50 50
#include <machine/resource.h>
51
#include <sys/select.h>
51
#include <sys/selinfo.h>
52 52

  
53 53
/*
54 54
 *	Controller data - Specific to each slot controller.
sys/dev/misc/mse/mse.c 24 Apr 2006 20:48:38 -0000
51 51
#include <sys/kernel.h>
52 52
#include <sys/bus.h>
53 53
#include <sys/poll.h>
54
#include <sys/select.h>
54
#include <sys/selinfo.h>
55 55
#include <sys/thread2.h>
56 56
#include <sys/uio.h>
57 57

  
sys/dev/misc/psm/psm.c 24 Apr 2006 20:59:16 -0000
75 75
#include <sys/malloc.h>
76 76
#include <machine/bus.h>
77 77
#include <sys/rman.h>
78
#include <sys/select.h>
78
#include <sys/selinfo.h>
79 79
#include <sys/thread2.h>
80 80
#include <sys/time.h>
81 81
#include <sys/uio.h>
sys/dev/misc/syscons/apm/apm_saver.c 24 Apr 2006 21:10:51 -0000
40 40
#include <dev/video/fb/splashreg.h>
41 41
#include "../syscons.h"
42 42

  
43
#include <sys/select.h>
43
#include <sys/selinfo.h>
44 44
#include <machine/apm_bios.h>
45 45
#include <machine/pc/bios.h>
46 46
#include <i386/apm/apm.h>
sys/dev/misc/tw/tw.c 24 Apr 2006 20:55:08 -0000
147 147
#include <sys/kernel.h>
148 148
#include <sys/uio.h>
149 149
#include <sys/syslog.h>
150
#include <sys/select.h>
150
#include <sys/selinfo.h>
151 151
#include <sys/poll.h>
152 152
#include <sys/thread2.h>
153 153

  
sys/dev/raid/aac/aacvar.h 5 Jun 2006 22:19:37 -0000
267 267
#define AAC_LOCK_RELEASE(l)	lockmgr(l, LK_RELEASE)
268 268
#endif
269 269

  
270
#if defined(__FreeBSD__) && __FreeBSD_version >= 500005
271 270
#include <sys/selinfo.h>
272
#else
273
#include <sys/select.h>
274
#endif
275 271

  
276 272
/*
277 273
 * Per-controller structure.
sys/dev/video/bktr/bktr_i2c.c 24 Apr 2006 17:31:27 -0000
43 43
#include <sys/bus.h>
44 44
#include <sys/uio.h>
45 45

  
46
#include <sys/select.h>
46
#include <sys/selinfo.h>
47 47

  
48 48
#include <bus/pci/pcivar.h>
49 49
#include <bus/pci/pcireg.h>
sys/i386/acpica5/acpi_machdep.c 24 Apr 2006 17:36:11 -0000
45 45
 * APM driver emulation 
46 46
 */
47 47

  
48
#include <sys/select.h>
48
#include <sys/selinfo.h>
49 49

  
50 50
#include <machine/apm_bios.h>
51 51
#include <machine/pc/bios.h>
sys/i386/apm/apm.c 24 Apr 2006 17:37:35 -0000
27 27
#include <sys/time.h>
28 28
#include <sys/reboot.h>
29 29
#include <sys/bus.h>
30
#include <sys/select.h>
30
#include <sys/selinfo.h>
31 31
#include <sys/poll.h>
32 32
#include <sys/fcntl.h>
33 33
#include <sys/uio.h>
sys/i386/isa/asc.c 12 May 2006 10:43:36 -0000
47 47
#include <sys/malloc.h>
48 48
#include <sys/kernel.h>
49 49
#include <sys/poll.h>
50
#include <sys/select.h>
50
#include <sys/selinfo.h>
51 51
#include <sys/uio.h>
52 52
#include <sys/thread2.h>
53 53

  
sys/kern/kern_random.c 26 May 2006 11:29:45 -0000
45 45
#include <sys/md5.h>
46 46
#include <sys/poll.h>
47 47
#include <sys/random.h>
48
#include <sys/select.h>
48
#include <sys/selinfo.h>
49 49
#include <sys/systm.h>
50 50
#include <sys/systimer.h>
51 51
#include <sys/thread2.h>
sys/net/bpfdesc.h 20 Apr 2006 23:05:40 -0000
45 45
#define _NET_BPFDESC_H_
46 46

  
47 47
#include <sys/callout.h>
48
#include <sys/select.h>
48
#include <sys/selinfo.h>
49 49

  
50 50
/*
51 51
 * Descriptor associated with each open bpf file.
sys/net/i4b/layer4/i4b_i4bdrv.c 20 Apr 2006 23:16:27 -0000
55 55
#include <sys/mbuf.h>
56 56
#include <sys/socket.h>
57 57
#include <sys/thread2.h>
58
#include <sys/select.h>
58
#include <sys/selinfo.h>
59 59

  
60 60
#include <net/if.h>
61 61

  
sys/sys/eventvar.h 26 May 2006 11:28:02 -0000
42 42
#ifndef _SYS_EVENT_H_
43 43
#include <sys/event.h>
44 44
#endif
45
#ifndef _SYS_SELECT_H_
46
#include <sys/select.h>
45
#ifndef _SYS_SELINFO_H_
46
#include <sys/selinfo.h>
47 47
#endif
48 48

  
49 49

  
sys/sys/pipe.h 22 May 2006 10:00:31 -0000
33 33
#ifndef _SYS_TIME_H_
34 34
#include <sys/time.h>			/* for struct timespec */
35 35
#endif
36
#ifndef _SYS_SELECT_H_
37
#include <sys/select.h>			/* for struct selinfo */
36
#ifndef _SYS_SELINFO_H_
37
#include <sys/selinfo.h>		/* for struct selinfo */
38 38
#endif
39 39
#ifndef _SYS_XIO_H_
40 40
#include <sys/xio.h>			/* for struct xio */
sys/sys/select.h 8 Jun 2006 10:33:22 -0000
38 38
#ifndef _SYS_SELECT_H_
39 39
#define	_SYS_SELECT_H_
40 40

  
41
#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
42

  
43
#ifndef _SYS_EVENT_H_
44
#include <sys/event.h>			/* for struct klist */
41
#ifndef _SYS_SIGNAL_H_
42
#include <sys/signal.h>
45 43
#endif
46
#ifndef _SYS_NETISR_H_
47
#include <net/netisr.h>			/* for struct notifymsglist */
44
#ifndef _SYS_TIME_H_
45
#include <sys/time.h>
48 46
#endif
49 47

  
50 48
/*
51
 * Used to maintain information about processes that wish to be
52
 * notified when I/O becomes possible.
49
 * Select uses bit masks of file descriptors in longs.  These macros
50
 * manipulate such bit fields (the filesystem macros use chars).
51
 * FD_SETSIZE may be defined by the user, but the default here should
52
 * be enough for most uses.
53 53
 */
54
struct selinfo {
55
	pid_t	si_pid;			/* process to be notified */
56
	struct	klist si_note;		/* kernel note list */
57
	struct	notifymsglist si_mlist;	/* list of pending predicate messages */
58
	short	si_flags;		/* see below */
59
};
60
#define	SI_COLL	0x0001		/* collision occurred */
54
#ifndef FD_SETSIZE
55
#define FD_SETSIZE	1024
56
#endif
57

  
58
#ifndef NBBY
59
#define NBBY		8
60
#endif
61 61

  
62
#ifdef _KERNEL
63
struct thread;
62
typedef unsigned long   fd_mask;
63
#define NFDBITS (sizeof(fd_mask) * NBBY)	/* bits per mask */
64 64

  
65
void	selrecord (struct thread *selector, struct selinfo *);
66
void	selwakeup (struct selinfo *);
65
#ifndef howmany
66
#define howmany(x, y)	(((x) + ((y) - 1)) / (y))
67 67
#endif
68 68

  
69
#endif	/* _KERNEL || _KERNEL_STRUCTURES */
69
typedef struct fd_set {
70
	fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
71
} fd_set;
72

  
73
#define _fdset_mask(n)	((fd_mask)1 << ((n) % NFDBITS))
74
#define FD_SET(n, p)	((p)->fds_bits[(n)/NFDBITS] |= _fdset_mask(n))
75
#define FD_CLR(n, p)	((p)->fds_bits[(n)/NFDBITS] &= ~_fdset_mask(n))
76
#define FD_ISSET(n, p)	((p)->fds_bits[(n)/NFDBITS] & _fdset_mask(n))
77
#define FD_COPY(f, t)	bcopy(f, t, sizeof(*(f)))
78
#define FD_ZERO(p)	bzero(p, sizeof(*(p)))
79

  
80
int	select(int, fd_set * __restrict, fd_set * __restrict, fd_set * __restrict,
81
               struct timeval * __restrict);
82

  
70 83
#endif	/* !_SYS_SELECT_H_ */
sys/sys/selinfo.h 8 Jun 2006 19:07:58 -0000
1
/*-
2
 * Copyright (c) 1992, 1993
3
 *	The Regents of the University of California.  All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 * 3. All advertising materials mentioning features or use of this software
14
 *    must display the following acknowledgement:
15
 *	This product includes software developed by the University of
16
 *	California, Berkeley and its contributors.
17
 * 4. Neither the name of the University nor the names of its contributors
18
 *    may be used to endorse or promote products derived from this software
19
 *    without specific prior written permission.
20
 *
21
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31
 * SUCH DAMAGE.
32
 *
33
 *	@(#)selinfo.h	8.2 (Berkeley) 1/4/94
34
 */
35

  
36
#ifndef _SYS_SELINFO_H_
37
#define	_SYS_SELINFO_H_
38

  
39
#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
40

  
41
#include <sys/signal.h>
42

  
43
#include <sys/event.h>			/* for struct klist */
44
#include <net/netisr.h>			/* for struct notifymsglist */
45

  
46
/*
47
 * Used to maintain information about processes that wish to be
48
 * notified when I/O becomes possible.
49
 */
50
struct selinfo {
51
	pid_t	si_pid;			/* process to be notified */
52
	struct	klist si_note;		/* kernel note list */
53
	struct	notifymsglist si_mlist;	/* list of pending predicate messages */
54
	short	si_flags;		/* see below */
55
};
56
#define	SI_COLL	0x0001		/* collision occurred */
57

  
58
struct thread;
59

  
60
void	selrecord (struct thread *selector, struct selinfo *);
61
void	selwakeup (struct selinfo *);
62

  
63
#endif
64

  
65
#endif /* !_SYS_SELINFO_H_ */
sys/sys/socketvar.h 22 May 2006 10:07:05 -0000
44 44
#ifndef _SYS_QUEUE_H_
45 45
#include <sys/queue.h>			/* for TAILQ macros */
46 46
#endif
47
#ifndef _SYS_SELECT_H_
48
#include <sys/select.h>			/* for struct selinfo */
47
#ifndef _SYS_SELINFO_H_
48
#include <sys/selinfo.h>		/* for struct selinfo */
49 49
#endif
50 50

  
51 51
#if defined(_KERNEL) || defined(_KERNEL_STRUCTURES)
sys/sys/tty.h 22 May 2006 09:58:40 -0000
46 46
#ifndef _SYS_TERMIOS_H_
47 47
#include <sys/termios.h>
48 48
#endif
49
#ifndef _SYS_SELECT_H_
50
#include <sys/select.h>		/* For struct selinfo. */
49
#ifndef _SYS_SELINFO_H_
50
#include <sys/selinfo.h>
51 51
#endif
52 52

  
53 53
/*
sys/sys/types.h 8 Jun 2006 12:28:09 -0000
181 181
typedef __timer_t	timer_t;
182 182
#endif
183 183

  
184
#ifndef _POSIX_SOURCE
185
#define	NBBY	8		/* number of bits in a byte */
186

  
187
/*
188
 * Select uses bit masks of file descriptors in longs.  These macros
189
 * manipulate such bit fields (the filesystem macros use chars).
190
 * FD_SETSIZE may be defined by the user, but the default here should
191
 * be enough for most uses.
192
 */
193
#ifndef	FD_SETSIZE
194
#define	FD_SETSIZE	1024
184
#ifndef _SYS_SELECT_H_
185
#include <sys/select.h>
195 186
#endif
196 187

  
197
typedef	unsigned long	fd_mask;
198
#define	NFDBITS	(sizeof(fd_mask) * NBBY)	/* bits per mask */
199

  
200
#ifndef howmany
201
#define	howmany(x, y)	(((x) + ((y) - 1)) / (y))
202
#endif
203

  
204
typedef	struct fd_set {
205
	fd_mask	fds_bits[howmany(FD_SETSIZE, NFDBITS)];
206
} fd_set;
207

  
208
#define	_fdset_mask(n)	((fd_mask)1 << ((n) % NFDBITS))
209
#define	FD_SET(n, p)	((p)->fds_bits[(n)/NFDBITS] |= _fdset_mask(n))
210
#define	FD_CLR(n, p)	((p)->fds_bits[(n)/NFDBITS] &= ~_fdset_mask(n))
211
#define	FD_ISSET(n, p)	((p)->fds_bits[(n)/NFDBITS] & _fdset_mask(n))
212
#define	FD_COPY(f, t)	bcopy(f, t, sizeof(*(f)))
213
#define	FD_ZERO(p)	bzero(p, sizeof(*(p)))
188
#ifndef _POSIX_SOURCE
214 189

  
190
#define NBBY 8		/* number of bits in a byte */
215 191
/*
216 192
 * These declarations belong elsewhere, but are repeated here and in
217 193
 * <stdio.h> to give broken programs a better chance of working with
sys/sys/vnode.h 5 Jun 2006 22:19:56 -0000
46 46
#ifndef _SYS_LOCK_H_
47 47
#include <sys/lock.h>
48 48
#endif
49
#ifndef _SYS_SELECT_H_
50
#include <sys/select.h>
49
#ifndef _SYS_SELINFO_H_
50
#include <sys/selinfo.h>
51 51
#endif
52 52
#ifndef _SYS_BIOTRACK_H_
53 53
#include <sys/biotrack.h>