sockets: poll Open Group clean ups

1) Define remaining Open Group poll constants (values in hex)
2) Switch nfds_t to unsigned int

http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
This commit is contained in:
Joel Cunningham 2017-10-16 14:51:29 -05:00
parent 1960937df3
commit 9c175835d5

View File

@ -490,12 +490,18 @@ typedef struct fd_set
/* poll-related defines and types */ /* poll-related defines and types */
/* @todo: find a better way to guard the definition of these defines and types if already defined */ /* @todo: find a better way to guard the definition of these defines and types if already defined */
#if !defined(POLLIN) && !defined(POLLOUT) #if !defined(POLLIN) && !defined(POLLOUT)
#define POLLIN 1 #define POLLIN 0x1
#define POLLOUT 2 #define POLLOUT 0x2
#define POLLERR 4 #define POLLERR 0x4
#define POLLNVAL 8 #define POLLNVAL 0x8
/* No support for POLLPRI, POLLHUP, POLLMSG, POLLRDBAND, POLLWRBAND. */ /* Below values are unimplemented */
typedef int nfds_t; #define POLLRDNORM 0x10
#define POLLRDBAND 0x20
#define POLLPRI 0x40
#define POLLWRNORM 0x80
#define POLLWRBAND 0x100
#define POLLHUP 0x200
typedef unsigned int nfds_t;
struct pollfd struct pollfd
{ {
int fd; int fd;