1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 2 3.. _media-func-close: 4 5************* 6media close() 7************* 8 9Name 10==== 11 12media-close - Close a media device 13 14 15Synopsis 16======== 17 18.. code-block:: c 19 20 #include <unistd.h> 21 22 23.. c:function:: int close( int fd ) 24 :name: mc-close 25 26Arguments 27========= 28 29``fd`` 30 File descriptor returned by :c:func:`open() <mc-open>`. 31 32 33Description 34=========== 35 36Closes the media device. Resources associated with the file descriptor 37are freed. The device configuration remain unchanged. 38 39 40Return Value 41============ 42 43:ref:`close() <media-func-close>` returns 0 on success. On error, -1 is returned, and 44``errno`` is set appropriately. Possible error codes are: 45 46EBADF 47 ``fd`` is not a valid open file descriptor. 48