diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index 7d37b73ef1..99ff9563fe 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@
User's Manual
by
Gregory Nutt
-
Last Updated: September 10, 2008
+Last Updated: November 18, 2008
@@ -5998,14 +5998,23 @@ interface of the same name.fcntl.hunistd.hsys/ioctl.hpoll.hsys/select.h#include <fcntl.h> int open(const char *path, int oflag, ...);- - +
#include <unistd.h> int close(int fd); @@ -6016,14 +6025,103 @@ interface of the same name. int unlink(const char *path); ssize_t write(int fd, const void *buf, size_t nbytes);- - +
#include <sys/ioctl.h> int ioctl(int fd, int req, unsigned long arg);- + +
+ Function Prototype: +
++ #include <poll.h> + int poll(struct pollfd *fds, nfds_t nfds, int timeout); ++
+ Description:
+ poll() waits for one of a set of file descriptors to become ready to
+ perform I/O. If none of the events requested (and no error) has
+ occurred for any of the file descriptors, then poll() blocks until
+ one of the events occurs.
+
+ Input Parameters: +
+fds. List of structures describing file descriptors to be monitored.nfds. The number of entries in the list.timeout. Specifies an upper limit on the time for which poll() will
+ block in milliseconds. A negative value of timeout means an infinite
+ timeout.+ Returned Values: +
+
+ On success, the number of structures that have nonzero errno is set appropriately:
+
EBADF. An invalid file descriptor was given in one of the sets.EFAULT. The fds address is invalidEINTR. A signal occurred before any requested event.EINVAL. The nfds value exceeds a system limit.ENOMEM. There was no space to allocate internal data structures.ENOSYS. One or more of the drivers supporting the file descriptor does not support the poll method.+ Function Prototype: +
++ #include <sys/select.h> + int select(int nfds, FAR fd_set *readfds, FAR fd_set *writefds, + FAR fd_set *exceptfds, FAR struct timeval *timeout); ++
+ Description:
+ select() allows a program to monitor multiple file descriptors, waiting
+ until one or more of the file descriptors become "ready" for some class
+ of I/O operation (e.g., input possible). A file descriptor is
+ considered ready if it is possible to perform the corresponding I/O
+ operation (e.g., read(2)) without blocking.
+
+ NOTE: poll() is the fundamental API for performing such monitoring
+ operation under NuttX. select() is provided for compatibility and
+ is simply a layer of added logic on top of poll(). As such, select()
+ is more wasteful of resources and poll() is the recommended API to be
+ used.
+
+ Input Parameters: +
+nfds. the maximum file descriptor number (+1) of any descriptor in any of the three sets.readfds. the set of descriptions to monitor for read-ready eventswritefds. the set of descriptions to monitor for write-ready eventsexceptfds. the set of descriptions to monitor for error eventstimeout. Return at this time if none of these events of interest occur.+ Returned Values: +
+0: Timer expired>0: The number of bits set in the three sets of descriptors-1: An error occurred (errno will be set appropriately,
+ see poll()).