1180744Sdes/*	$OpenBSD: poll.h,v 1.11 2003/12/10 23:10:08 millert Exp $ */
2180744Sdes
3180744Sdes/*
4180744Sdes * Copyright (c) 1996 Theo de Raadt
5180744Sdes * All rights reserved.
6180744Sdes *
7180744Sdes * Redistribution and use in source and binary forms, with or without
8180744Sdes * modification, are permitted provided that the following conditions
9180744Sdes * are met:
10180744Sdes * 1. Redistributions of source code must retain the above copyright
11180744Sdes *    notice, this list of conditions and the following disclaimer.
12180744Sdes * 2. Redistributions in binary form must reproduce the above copyright
13180744Sdes *    notice, this list of conditions and the following disclaimer in the
14180744Sdes *    documentation and/or other materials provided with the distribution.
15180744Sdes *
16180744Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17180744Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18180744Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19180744Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20180744Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21180744Sdes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22180744Sdes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23180744Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24180744Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25180744Sdes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26180744Sdes */
27180744Sdes
28180744Sdes/* OPENBSD ORIGINAL: sys/sys/poll.h */
29180744Sdes
30180744Sdes#if !defined(HAVE_POLL) && !defined(HAVE_POLL_H)
31180744Sdes#ifndef	_COMPAT_POLL_H_
32180744Sdes#define	_COMPAT_POLL_H_
33180744Sdes
34180744Sdestypedef struct pollfd {
35180744Sdes	int 	fd;
36180744Sdes	short	events;
37180744Sdes	short	revents;
38180744Sdes} pollfd_t;
39180744Sdes
40180744Sdestypedef unsigned int	nfds_t;
41180744Sdes
42180744Sdes#define	POLLIN		0x0001
43180744Sdes#define	POLLOUT		0x0004
44180744Sdes#define	POLLERR		0x0008
45296781Sdes#define	POLLHUP		0x0010
46296781Sdes#define	POLLNVAL	0x0020
47180744Sdes#if 0
48180744Sdes/* the following are currently not implemented */
49180744Sdes#define	POLLPRI		0x0002
50180744Sdes#define	POLLRDNORM	0x0040
51180744Sdes#define POLLNORM	POLLRDNORM
52180744Sdes#define POLLWRNORM      POLLOUT
53180744Sdes#define	POLLRDBAND	0x0080
54180744Sdes#define	POLLWRBAND	0x0100
55180744Sdes#endif
56180744Sdes
57180744Sdes#define INFTIM		(-1)	/* not standard */
58180744Sdes
59180744Sdesint   poll(struct pollfd *, nfds_t, int);
60180744Sdes#endif /* !_COMPAT_POLL_H_ */
61180744Sdes#endif /* !HAVE_POLL_H */
62