newlib/winsup/cygwin/include/sys/poll.h
Corinna Vinschen b23bc8c33c * fhandler_socket.cc (fhandler_socket::recv_internal): Fix a problem
with poll(2) after shutdown(SHUT_RD) has been called on the local side.
	* poll.cc (poll): Use POSIX type nfds_t for second parameter.  Drop
	special socket handling for POLLIN.  Add comment to explain why.
	* include/sys/poll.h: Declare nfds_t.  Use as type for second parameter
	in poll(2) declaration.
2006-07-31 14:27:56 +00:00

46 lines
1.1 KiB
C

/* sys/poll.h
Copyright 2000, 2001, 2006 Red Hat, Inc.
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>
__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. */
#define POLLERR 8 /* An error occured. */
#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;
};
typedef unsigned int nfds_t;
extern int poll __P ((struct pollfd *fds, nfds_t nfds, int timeout));
__END_DECLS
#endif /* _SYS_POLL_H */