| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | .. Permission is granted to copy, distribute and/or modify this |
| 2 | .. document under the terms of the GNU Free Documentation License, |
| 3 | .. Version 1.1 or any later version published by the Free Software |
| 4 | .. Foundation, with no Invariant Sections, no Front-Cover Texts |
| 5 | .. and no Back-Cover Texts. A copy of the license is included at |
| 6 | .. Documentation/media/uapi/fdl-appendix.rst. |
| 7 | .. |
| 8 | .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections |
| 9 | |
| 10 | .. _func-close: |
| 11 | |
| 12 | ************ |
| 13 | V4L2 close() |
| 14 | ************ |
| 15 | |
| 16 | Name |
| 17 | ==== |
| 18 | |
| 19 | v4l2-close - Close a V4L2 device |
| 20 | |
| 21 | |
| 22 | Synopsis |
| 23 | ======== |
| 24 | |
| 25 | .. code-block:: c |
| 26 | |
| 27 | #include <unistd.h> |
| 28 | |
| 29 | |
| 30 | .. c:function:: int close( int fd ) |
| 31 | :name: v4l2-close |
| 32 | |
| 33 | Arguments |
| 34 | ========= |
| 35 | |
| 36 | ``fd`` |
| 37 | File descriptor returned by :ref:`open() <func-open>`. |
| 38 | |
| 39 | |
| 40 | Description |
| 41 | =========== |
| 42 | |
| 43 | Closes the device. Any I/O in progress is terminated and resources |
| 44 | associated with the file descriptor are freed. However data format |
| 45 | parameters, current input or output, control values or other properties |
| 46 | remain unchanged. |
| 47 | |
| 48 | |
| 49 | Return Value |
| 50 | ============ |
| 51 | |
| 52 | The function returns 0 on success, -1 on failure and the ``errno`` is |
| 53 | set appropriately. Possible error codes: |
| 54 | |
| 55 | EBADF |
| 56 | ``fd`` is not a valid open file descriptor. |