0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: V4L
0003
0004 .. _func-close:
0005
0006 ************
0007 V4L2 close()
0008 ************
0009
0010 Name
0011 ====
0012
0013 v4l2-close - Close a V4L2 device
0014
0015 Synopsis
0016 ========
0017
0018 .. code-block:: c
0019
0020 #include <unistd.h>
0021
0022 .. c:function:: int close( int fd )
0023
0024 Arguments
0025 =========
0026
0027 ``fd``
0028 File descriptor returned by :c:func:`open()`.
0029
0030 Description
0031 ===========
0032
0033 Closes the device. Any I/O in progress is terminated and resources
0034 associated with the file descriptor are freed. However data format
0035 parameters, current input or output, control values or other properties
0036 remain unchanged.
0037
0038 Return Value
0039 ============
0040
0041 The function returns 0 on success, -1 on failure and the ``errno`` is
0042 set appropriately. Possible error codes:
0043
0044 EBADF
0045 ``fd`` is not a valid open file descriptor.