bsd-poll.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* $OpenBSD: poll.h,v 1.11 2003/12/10 23:10:08 millert Exp $ */
  2. /*
  3. * Copyright (c) 1996 Theo de Raadt
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. *
  15. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  16. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  17. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  18. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  19. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  20. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  21. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  22. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  23. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  24. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. */
  26. /* OPENBSD ORIGINAL: sys/sys/poll.h */
  27. #if !defined(HAVE_POLL) && !defined(HAVE_POLL_H)
  28. #ifndef _COMPAT_POLL_H_
  29. #define _COMPAT_POLL_H_
  30. typedef struct pollfd {
  31. int fd;
  32. short events;
  33. short revents;
  34. } pollfd_t;
  35. typedef unsigned int nfds_t;
  36. #define POLLIN 0x0001
  37. #define POLLOUT 0x0004
  38. #define POLLERR 0x0008
  39. #define POLLHUP 0x0010
  40. #define POLLNVAL 0x0020
  41. #if 0
  42. /* the following are currently not implemented */
  43. #define POLLPRI 0x0002
  44. #define POLLRDNORM 0x0040
  45. #define POLLNORM POLLRDNORM
  46. #define POLLWRNORM POLLOUT
  47. #define POLLRDBAND 0x0080
  48. #define POLLWRBAND 0x0100
  49. #endif
  50. #define INFTIM (-1) /* not standard */
  51. int poll(struct pollfd *, nfds_t, int);
  52. #endif /* !_COMPAT_POLL_H_ */
  53. #endif /* !HAVE_POLL_H */