summaryrefslogtreecommitdiffstats
path: root/src/poll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/poll.c')
-rw-r--r--src/poll.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/poll.c b/src/poll.c
index a36539a..4e7cda3 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -72,12 +72,12 @@
\*---------------------------------------------------------------------------*/
#include <unistd.h> /* standard Unix definitions */
-#include <sys/types.h> /* system types */
-#include <sys/time.h> /* time definitions */
-#include <assert.h> /* assertion macros */
-#include <string.h> /* string functions */
+#include <sys/types.h> /* system types */
+#include <sys/time.h> /* time definitions */
+#include <assert.h> /* assertion macros */
+#include <string.h> /* string functions */
-#include "poll-compat.h" /* this package */
+#include "poll-compat.h" /* this package */
/*---------------------------------------------------------------------------*\
Macros
@@ -96,21 +96,21 @@ static int map_poll_spec
#if __STDC__ > 0
(struct pollfd *pArray,
unsigned long n_fds,
- fd_set *pReadSet,
- fd_set *pWriteSet,
- fd_set *pExceptSet)
+ fd_set *pReadSet,
+ fd_set *pWriteSet,
+ fd_set *pExceptSet)
#else
(pArray, n_fds, pReadSet, pWriteSet, pExceptSet)
struct pollfd *pArray;
unsigned long n_fds;
- fd_set *pReadSet;
- fd_set *pWriteSet;
- fd_set *pExceptSet;
+ fd_set *pReadSet;
+ fd_set *pWriteSet;
+ fd_set *pExceptSet;
#endif
{
- register unsigned long i; /* loop control */
- register struct pollfd *pCur; /* current array element */
- register int max_fd = -1; /* return value */
+ register unsigned long i; /* loop control */
+ register struct pollfd *pCur; /* current array element */
+ register int max_fd = -1; /* return value */
/*
Map the poll() structures into the file descriptor sets required
@@ -118,10 +118,10 @@ static int map_poll_spec
*/
for (i = 0, pCur = pArray; i < n_fds; i++, pCur++)
{
- /* Skip any bad FDs in the array. */
+ /* Skip any bad FDs in the array. */
- if (pCur->fd < 0)
- continue;
+ if (pCur->fd < 0)
+ continue;
if (pCur->events & POLLIN)
{
@@ -155,7 +155,7 @@ static struct timeval *map_timeout
(int poll_timeout, struct timeval *pSelTimeout)
#else
(poll_timeout, pSelTimeout)
- int poll_timeout;
+ int poll_timeout;
struct timeval *pSelTimeout;
#endif
{
@@ -168,7 +168,7 @@ static struct timeval *map_timeout
VALUE MEANING
-1 wait indefinitely (until signal occurs)
- 0 return immediately, don't block
+ 0 return immediately, don't block
>0 wait specified number of milliseconds
select() uses a "struct timeval", which specifies the timeout in
@@ -200,7 +200,7 @@ static struct timeval *map_timeout
default:
/* Wait the specified number of milliseconds. */
pSelTimeout->tv_sec = poll_timeout / 1000; /* get seconds */
- poll_timeout %= 1000; /* remove seconds */
+ poll_timeout %= 1000; /* remove seconds */
pSelTimeout->tv_usec = poll_timeout * 1000; /* get microseconds */
pResult = pSelTimeout;
break;
@@ -214,27 +214,27 @@ static void map_select_results
#if __STDC__ > 0
(struct pollfd *pArray,
unsigned long n_fds,
- fd_set *pReadSet,
- fd_set *pWriteSet,
- fd_set *pExceptSet)
+ fd_set *pReadSet,
+ fd_set *pWriteSet,
+ fd_set *pExceptSet)
#else
(pArray, n_fds, pReadSet, pWriteSet, pExceptSet)
struct pollfd *pArray;
unsigned long n_fds;
- fd_set *pReadSet;
- fd_set *pWriteSet;
- fd_set *pExceptSet;
+ fd_set *pReadSet;
+ fd_set *pWriteSet;
+ fd_set *pExceptSet;
#endif
{
- register unsigned long i; /* loop control */
- register struct pollfd *pCur; /* current array element */
+ register unsigned long i; /* loop control */
+ register struct pollfd *pCur; /* current array element */
for (i = 0, pCur = pArray; i < n_fds; i++, pCur++)
{
- /* Skip any bad FDs in the array. */
+ /* Skip any bad FDs in the array. */
- if (pCur->fd < 0)
- continue;
+ if (pCur->fd < 0)
+ continue;
/* Exception events take priority over input events. */
@@ -268,13 +268,13 @@ int poll
#endif
{
- fd_set read_descs; /* input file descs */
- fd_set write_descs; /* output file descs */
- fd_set except_descs; /* exception descs */
- struct timeval stime; /* select() timeout value */
- int ready_descriptors; /* function result */
- int max_fd; /* maximum fd value */
- struct timeval *pTimeout; /* actually passed */
+ fd_set read_descs; /* input file descs */
+ fd_set write_descs; /* output file descs */
+ fd_set except_descs; /* exception descs */
+ struct timeval stime; /* select() timeout value */
+ int ready_descriptors; /* function result */
+ int max_fd; /* maximum fd value */
+ struct timeval *pTimeout; /* actually passed */
FD_ZERO (&read_descs);
FD_ZERO (&write_descs);