v4l2-open - Open a V4L2 device
Open flags. Access mode must be O_RDWR. This is just a technicality, input devices still support only reading and output devices only writing.
When the O_NONBLOCK flag is given, the read() function and the VIDIOC_DQBUF ioctl will return the EAGAIN error code when no data is available or no buffer is in the driver outgoing queue, otherwise these functions block until data becomes available. All V4L2 drivers exchanging data with applications must support the O_NONBLOCK flag.
Other flags have no effect.
To open a V4L2 device applications call open() with the desired device name. This function has no side effects; all data format parameters, current input or output, control values or other properties remain unchanged. At the first open() call after loading the driver they will be reset to default values, drivers are never in an undefined state.
On success open() returns the new file descriptor. On error -1 is returned, and the errno variable is set appropriately. Possible error codes are: