change the required dependency for codec_dahdi to only be satisfied by DAHDI and...
[asterisk-bristuff.git] / include / asterisk / poll-compat.h
blob5f795a894131d6967ab102dbf4aa4a47764f4e29
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * See http://www.asterisk.org for more information about
5 * the Asterisk project. Please do not directly contact
6 * any of the maintainers of this project for assistance;
7 * the project provides a web site, mailing lists and IRC
8 * channels for your use.
9 */
11 /*---------------------------------------------------------------------------*\
12 $Id$
14 NAME
16 poll - select(2)-based poll() emulation function for BSD systems.
18 SYNOPSIS
19 #include "poll.h"
21 struct pollfd
23 int fd;
24 short events;
25 short revents;
28 int poll (struct pollfd *pArray, unsigned long n_fds, int timeout)
30 DESCRIPTION
32 This file, and the accompanying "poll.c", implement the System V
33 poll(2) system call for BSD systems (which typically do not provide
34 poll()). Poll() provides a method for multiplexing input and output
35 on multiple open file descriptors; in traditional BSD systems, that
36 capability is provided by select(). While the semantics of select()
37 differ from those of poll(), poll() can be readily emulated in terms
38 of select() -- which is how this function is implemented.
40 REFERENCES
41 Stevens, W. Richard. Unix Network Programming. Prentice-Hall, 1990.
43 NOTES
44 1. This software requires an ANSI C compiler.
46 LICENSE
48 This software is released under the following license:
50 Copyright (c) 1995-2002 Brian M. Clapper
51 All rights reserved.
53 Redistribution and use in source and binary forms are
54 permitted provided that: (1) source distributions retain
55 this entire copyright notice and comment; (2) modifications
56 made to the software are prominently mentioned, and a copy
57 of the original software (or a pointer to its location) are
58 included; and (3) distributions including binaries display
59 the following acknowledgement: "This product includes
60 software developed by Brian M. Clapper <bmc@clapper.org>"
61 in the documentation or other materials provided with the
62 distribution. The name of the author may not be used to
63 endorse or promote products derived from this software
64 without specific prior written permission.
66 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
67 OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
68 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
69 PARTICULAR PURPOSE.
71 Effectively, this means you can do what you want with the software
72 except remove this notice or take advantage of the author's name.
73 If you modify the software and redistribute your modified version,
74 you must indicate that your version is a modification of the
75 original, and you must provide either a pointer to or a copy of the
76 original.
77 \*---------------------------------------------------------------------------*/
79 #ifndef _POLL_EMUL_H_
80 #define _POLL_EMUL_H_
82 #define POLLIN 0x01
83 #define POLLPRI 0x02
84 #define POLLOUT 0x04
85 #define POLLERR 0x08
86 #define POLLHUP 0x10
87 #define POLLNVAL 0x20
89 struct pollfd
91 int fd;
92 short events;
93 short revents;
96 #ifdef __cplusplus
97 extern "C"
99 #endif
101 #if (__STDC__ > 0) || defined(__cplusplus)
102 extern int poll (struct pollfd *pArray, unsigned long n_fds, int timeout);
103 #else
104 extern int poll();
105 #endif
107 #ifdef __cplusplus
109 #endif
111 #endif /* _POLL_EMUL_H_ */