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/userspace-api/media/fdl-appendix.rst. 7.. 8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections 9 10.. _media-func-close: 11 12************* 13media close() 14************* 15 16Name 17==== 18 19media-close - Close a media device 20 21 22Synopsis 23======== 24 25.. code-block:: c 26 27 #include <unistd.h> 28 29 30.. c:function:: int close( int fd ) 31 :name: mc-close 32 33Arguments 34========= 35 36``fd`` 37 File descriptor returned by :c:func:`open() <mc-open>`. 38 39 40Description 41=========== 42 43Closes the media device. Resources associated with the file descriptor 44are freed. The device configuration remain unchanged. 45 46 47Return Value 48============ 49 50:ref:`close() <media-func-close>` returns 0 on success. On error, -1 is returned, and 51``errno`` is set appropriately. Possible error codes are: 52 53EBADF 54 ``fd`` is not a valid open file descriptor. 55