poll.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Compatibility definitions for System V `poll' interface.
  2. Copyright (C) 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with the GNU C Library; see the file COPYING.LIB. If not,
  14. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA. */
  16. #ifndef _SYS_POLL_H
  17. #define _SYS_POLL_H 1
  18. #include <features.h>
  19. /* Get the platform dependent bits of `poll'. */
  20. #include <bits/poll.h>
  21. __BEGIN_DECLS
  22. /* Data structure describing a polling request. */
  23. struct pollfd
  24. {
  25. int fd; /* File descriptor to poll. */
  26. short int events; /* Types of events poller cares about. */
  27. short int revents; /* Types of events that actually occurred. */
  28. };
  29. /* Poll the file descriptors described by the NFDS structures starting at
  30. FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
  31. an event to occur; if TIMEOUT is -1, block until an event occurs.
  32. Returns the number of file descriptors with events, zero if timed out,
  33. or -1 for errors. */
  34. extern int __poll __P ((struct pollfd *__fds, unsigned long int __nfds,
  35. int __timeout));
  36. extern int poll __P ((struct pollfd *__fds, unsigned long int __nfds,
  37. int __timeout));
  38. __END_DECLS
  39. #endif /* sys/poll.h */