From 8d4f9d241cdbd71a882a852c6e9285de279c0f87 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 18 Jan 2009 13:00:12 +0100 Subject: v4l2spec: add version 0.24 of the spec From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- v4l2-spec/func-ioctl.sgml | 146 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 v4l2-spec/func-ioctl.sgml (limited to 'v4l2-spec/func-ioctl.sgml') diff --git a/v4l2-spec/func-ioctl.sgml b/v4l2-spec/func-ioctl.sgml new file mode 100644 index 000000000..96dead0ec --- /dev/null +++ b/v4l2-spec/func-ioctl.sgml @@ -0,0 +1,146 @@ + + + V4L2 ioctl() + &manvol; + + + + v4l2-ioctl + Program a V4L2 device + + + + + #include <sys/ioctl.h> + + int ioctl + int fd + int request + void *argp + + + + + + Arguments + + + + fd + + &fd; + + + + request + + V4L2 ioctl request code as defined in the videodev.h header file, for example +VIDIOC_QUERYCAP. + + + + argp + + Pointer to a function parameter, usually a structure. + + + + + + + Description + + The ioctl() function is used to program +V4L2 devices. The argument fd must be an open +file descriptor. An ioctl request has encoded +in it whether the argument is an input, output or read/write +parameter, and the size of the argument argp in +bytes. Macros and defines specifying V4L2 ioctl requests are located +in the videodev.h header file. +Applications should use their own copy, not include the version in the +kernel sources on the system they compile on. All V4L2 ioctl requests, +their respective function and parameters are specified in . + + + + Return Value + + On success the ioctl() function returns +0 and does not reset the +errno variable. On failure +-1 is returned, when the ioctl takes an +output or read/write parameter it remains unmodified, and the +errno variable is set appropriately. See below for +possible error codes. Generic errors like EBADF +or EFAULT are not listed in the sections +discussing individual ioctl requests. + Note ioctls may return undefined error codes. Since errors +may have side effects such as a driver reset applications should +abort on unexpected errors. + + + + EBADF + + fd is not a valid open file +descriptor. + + + + EBUSY + + The property cannot be changed right now. Typically +this error code is returned when I/O is in progress or the driver +supports multiple opens and another process locked the property. + + + + EFAULT + + argp references an inaccessible +memory area. + + + + ENOTTY + + fd is not associated with a +character special device. + + + + EINVAL + + The request or the data pointed +to by argp is not valid. This is a very common +error code, see the individual ioctl requests listed in for actual causes. + + + + ENOMEM + + Not enough physical or virtual memory was available to +complete the request. + + + + ERANGE + + The application attempted to set a control with the +&VIDIOC-S-CTRL; ioctl to a value which is out of bounds. + + + + + + + -- cgit v1.2.3