diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2008-11-17 20:27:26 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2008-11-17 20:27:26 +0000 |
commit | 1590d317044e33809d1b466ef79e9de842bf419e (patch) | |
tree | 20da5f483bee2f1b369987a1ffafc6ae328c47a7 /nuttx/include/poll.h | |
parent | bdacaaed89d22a04ea77e4f73ae7381b7df4cb0d (diff) |
Initial integration of poll()
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1266 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/include/poll.h')
-rw-r--r-- | nuttx/include/poll.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/nuttx/include/poll.h b/nuttx/include/poll.h index 1dd6fc180e..e82d48f57c 100644 --- a/nuttx/include/poll.h +++ b/nuttx/include/poll.h @@ -89,14 +89,25 @@ * Public Type Definitions ****************************************************************************/ +/* The number of poll descriptors (required by poll() specification */ + typedef unsigned int nfds_t; +/* In the standard poll() definition, the size of the event set is 'short'. + * Here we pick the smallest storage element that will contain all of the + * poll events. + */ + +typedef ubyte pollevent_t; + +/* This is the Nuttx variant of the standard pollfd structure. */ + struct pollfd { - int fd; /* The descriptor being polled */ - sem_t *sem; /* Pointer to semaphore used to post output event */ - ubyte events; /* The input event flags */ - ubyte revents; /* The output event flags */ + int fd; /* The descriptor being polled */ + sem_t *sem; /* Pointer to semaphore used to post output event */ + pollevent_t events; /* The input event flags */ + pollevent_t revents; /* The output event flags */ }; /**************************************************************************** |