Mauro Carvalho Chehab | 82559ac | 2018-08-30 10:15:26 -0400 | [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 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 10 | .. _cec-func-close: |
| 11 | |
| 12 | *********** |
| 13 | cec close() |
| 14 | *********** |
| 15 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 16 | Name |
| 17 | ==== |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 18 | |
Markus Heiser | 21c6269 | 2016-07-08 20:55:43 +0200 | [diff] [blame] | 19 | cec-close - Close a cec device |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 20 | |
| 21 | |
| 22 | Synopsis |
| 23 | ======== |
| 24 | |
| 25 | .. code-block:: c |
| 26 | |
| 27 | #include <unistd.h> |
| 28 | |
| 29 | |
Mauro Carvalho Chehab | 1b81f01 | 2016-08-19 12:00:43 -0300 | [diff] [blame] | 30 | .. c:function:: int close( int fd ) |
Mauro Carvalho Chehab | 9954783 | 2016-08-19 16:58:14 -0300 | [diff] [blame] | 31 | :name: cec-close |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 32 | |
| 33 | Arguments |
| 34 | ========= |
| 35 | |
| 36 | ``fd`` |
Mauro Carvalho Chehab | 9954783 | 2016-08-19 16:58:14 -0300 | [diff] [blame] | 37 | File descriptor returned by :c:func:`open() <cec-open>`. |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 38 | |
| 39 | |
| 40 | Description |
| 41 | =========== |
| 42 | |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 43 | Closes the cec device. Resources associated with the file descriptor are |
| 44 | freed. The device configuration remain unchanged. |
| 45 | |
| 46 | |
| 47 | Return Value |
| 48 | ============ |
| 49 | |
Hans Verkuil | cfaf384 | 2017-07-28 06:31:50 -0400 | [diff] [blame] | 50 | :c:func:`close() <cec-close>` returns 0 on success. On error, -1 is returned, and |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 51 | ``errno`` is set appropriately. Possible error codes are: |
| 52 | |
Mauro Carvalho Chehab | b2a5843 | 2016-07-08 17:59:27 -0300 | [diff] [blame] | 53 | ``EBADF`` |
Markus Heiser | e2460b1 | 2016-07-08 20:55:42 +0200 | [diff] [blame] | 54 | ``fd`` is not a valid open file descriptor. |