Markus Heiser | 5377d91 | 2016-06-30 15:18:56 +0200 | [diff] [blame^] | 1 | .. -*- coding: utf-8; mode: rst -*- |
| 2 | |
| 3 | .. _func-close: |
| 4 | |
| 5 | ************ |
| 6 | V4L2 close() |
| 7 | ************ |
| 8 | |
| 9 | *man v4l2-close(2)* |
| 10 | |
| 11 | Close a V4L2 device |
| 12 | |
| 13 | |
| 14 | Synopsis |
| 15 | ======== |
| 16 | |
| 17 | .. code-block:: c |
| 18 | |
| 19 | #include <unistd.h> |
| 20 | |
| 21 | |
| 22 | .. c:function:: int close( int fd ) |
| 23 | |
| 24 | Arguments |
| 25 | ========= |
| 26 | |
| 27 | ``fd`` |
| 28 | File descriptor returned by :ref:`open() <func-open>`. |
| 29 | |
| 30 | |
| 31 | Description |
| 32 | =========== |
| 33 | |
| 34 | Closes the device. Any I/O in progress is terminated and resources |
| 35 | associated with the file descriptor are freed. However data format |
| 36 | parameters, current input or output, control values or other properties |
| 37 | remain unchanged. |
| 38 | |
| 39 | |
| 40 | Return Value |
| 41 | ============ |
| 42 | |
| 43 | The function returns 0 on success, -1 on failure and the ``errno`` is |
| 44 | set appropriately. Possible error codes: |
| 45 | |
| 46 | EBADF |
| 47 | ``fd`` is not a valid open file descriptor. |
| 48 | |
| 49 | |
| 50 | .. ------------------------------------------------------------------------------ |
| 51 | .. This file was automatically converted from DocBook-XML with the dbxml |
| 52 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes |
| 53 | .. from the linux kernel, refer to: |
| 54 | .. |
| 55 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook |
| 56 | .. ------------------------------------------------------------------------------ |