func-close.rst 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: V4L
  3. .. _func-close:
  4. ************
  5. V4L2 close()
  6. ************
  7. Name
  8. ====
  9. v4l2-close - Close a V4L2 device
  10. Synopsis
  11. ========
  12. .. code-block:: c
  13. #include <unistd.h>
  14. .. c:function:: int close( int fd )
  15. Arguments
  16. =========
  17. ``fd``
  18. File descriptor returned by :c:func:`open()`.
  19. Description
  20. ===========
  21. Closes the device. Any I/O in progress is terminated and resources
  22. associated with the file descriptor are freed. However data format
  23. parameters, current input or output, control values or other properties
  24. remain unchanged.
  25. Return Value
  26. ============
  27. The function returns 0 on success, -1 on failure and the ``errno`` is
  28. set appropriately. Possible error codes:
  29. EBADF
  30. ``fd`` is not a valid open file descriptor.