From 9c175835d5eab03c8b4213bb02a6e83f9925cf44 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Mon, 16 Oct 2017 14:51:29 -0500 Subject: [PATCH] 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 --- src/include/lwip/sockets.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 08de9455..eaf71434 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -490,12 +490,18 @@ typedef struct fd_set /* poll-related defines and types */ /* @todo: find a better way to guard the definition of these defines and types if already defined */ #if !defined(POLLIN) && !defined(POLLOUT) -#define POLLIN 1 -#define POLLOUT 2 -#define POLLERR 4 -#define POLLNVAL 8 -/* No support for POLLPRI, POLLHUP, POLLMSG, POLLRDBAND, POLLWRBAND. */ -typedef int nfds_t; +#define POLLIN 0x1 +#define POLLOUT 0x2 +#define POLLERR 0x4 +#define POLLNVAL 0x8 +/* Below values are unimplemented */ +#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 { int fd;