2000-07-05 00:58:49 +08:00
|
|
|
/* sys/poll.h
|
|
|
|
|
|
|
|
This file is part of Cygwin.
|
|
|
|
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
|
|
details. */
|
|
|
|
|
|
|
|
#ifndef _SYS_POLL_H
|
|
|
|
#define _SYS_POLL_H
|
|
|
|
|
|
|
|
#include <sys/cdefs.h>
|
2011-04-18 20:00:05 +08:00
|
|
|
#include <sys/types.h>
|
2011-04-21 15:18:42 +08:00
|
|
|
#include <signal.h>
|
2000-07-05 00:58:49 +08:00
|
|
|
|
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
#define POLLIN 1 /* Set if data to read. */
|
|
|
|
#define POLLPRI 2 /* Set if urgent data to read. */
|
|
|
|
#define POLLOUT 4 /* Set if writing data wouldn't block. */
|
2000-08-11 20:51:47 +08:00
|
|
|
#define POLLERR 8 /* An error occured. */
|
2000-07-05 00:58:49 +08:00
|
|
|
#define POLLHUP 16 /* Shutdown or close happened. */
|
|
|
|
#define POLLNVAL 32 /* Invalid file descriptor. */
|
|
|
|
|
|
|
|
#define NPOLLFILE 64 /* Number of canonical fd's in one call to poll(). */
|
|
|
|
|
|
|
|
/* The following values are defined by XPG4. */
|
|
|
|
#define POLLRDNORM POLLIN
|
|
|
|
#define POLLRDBAND POLLPRI
|
|
|
|
#define POLLWRNORM POLLOUT
|
|
|
|
#define POLLWRBAND POLLOUT
|
|
|
|
|
|
|
|
struct pollfd {
|
|
|
|
int fd;
|
|
|
|
short events;
|
|
|
|
short revents;
|
|
|
|
};
|
|
|
|
|
2006-07-31 22:27:56 +08:00
|
|
|
typedef unsigned int nfds_t;
|
|
|
|
|
|
|
|
extern int poll __P ((struct pollfd *fds, nfds_t nfds, int timeout));
|
2017-03-27 22:19:36 +08:00
|
|
|
#if __GNU_VISIBLE
|
2011-04-18 20:00:05 +08:00
|
|
|
extern int ppoll __P ((struct pollfd *fds, nfds_t nfds,
|
|
|
|
const struct timespec *timeout_ts,
|
|
|
|
const sigset_t *sigmask));
|
2017-03-27 22:19:36 +08:00
|
|
|
#endif
|
2000-07-05 00:58:49 +08:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
2017-11-30 01:38:17 +08:00
|
|
|
#if __SSP_FORTIFY_LEVEL > 0
|
|
|
|
#include <ssp/poll.h>
|
|
|
|
#endif
|
|
|
|
|
2000-07-05 00:58:49 +08:00
|
|
|
#endif /* _SYS_POLL_H */
|