From 849369d6c66d3054688672f97d31fceb8e8230fb Mon Sep 17 00:00:00 2001 From: root Date: Fri, 25 Dec 2015 04:40:36 +0000 Subject: initial_commit --- Documentation/DocBook/v4l/func-select.xml | 138 ++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 Documentation/DocBook/v4l/func-select.xml (limited to 'Documentation/DocBook/v4l/func-select.xml') diff --git a/Documentation/DocBook/v4l/func-select.xml b/Documentation/DocBook/v4l/func-select.xml new file mode 100644 index 00000000..b6713623 --- /dev/null +++ b/Documentation/DocBook/v4l/func-select.xml @@ -0,0 +1,138 @@ + + + V4L2 select() + &manvol; + + + + v4l2-select + Synchronous I/O multiplexing + + + + + +#include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> + + int select + int nfds + fd_set *readfds + fd_set *writefds + fd_set *exceptfds + struct timeval *timeout + + + + + + Description + + With the select() function applications +can suspend execution until the driver has captured data or is ready +to accept data for output. + + When streaming I/O has been negotiated this function waits +until a buffer has been filled or displayed and can be dequeued with +the &VIDIOC-DQBUF; ioctl. When buffers are already in the outgoing +queue of the driver the function returns immediately. + + On success select() returns the total +number of bits set in the fd_sets. When the +function timed out it returns a value of zero. On failure it returns +-1 and the errno +variable is set appropriately. When the application did not call +&VIDIOC-QBUF; or &VIDIOC-STREAMON; yet the +select() function succeeds, setting the bit of +the file descriptor in readfds or +writefds, but subsequent &VIDIOC-DQBUF; calls +will fail.The Linux kernel implements +select() like the &func-poll; function, but +select() cannot return a +POLLERR. + + + When use of the read() function has +been negotiated and the driver does not capture yet, the +select() function starts capturing. When that +fails, select() returns successful and a +subsequent read() call, which also attempts to +start capturing, will return an appropriate error code. When the +driver captures continuously (as opposed to, for example, still +images) and data is already available the +select() function returns immediately. + + When use of the write() function has +been negotiated the select() function just waits +until the driver is ready for a non-blocking +write() call. + + All drivers implementing the read() or +write() function or streaming I/O must also +support the select() function. + + For more details see the select() +manual page. + + + + + Return Value + + On success, select() returns the number +of descriptors contained in the three returned descriptor sets, which +will be zero if the timeout expired. On error +-1 is returned, and the +errno variable is set appropriately; the sets and +timeout are undefined. Possible error codes +are: + + + + EBADF + + One or more of the file descriptor sets specified a +file descriptor that is not open. + + + + EBUSY + + The driver does not support multiple read or write +streams and the device is already in use. + + + + EFAULT + + The readfds, +writefds, exceptfds or +timeout pointer references an inaccessible memory +area. + + + + EINTR + + The call was interrupted by a signal. + + + + EINVAL + + The nfds argument is less than +zero or greater than FD_SETSIZE. + + + + + + + -- cgit v1.2.3