media-func-close.rst 734 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: MC
  3. .. _media-func-close:
  4. *************
  5. media close()
  6. *************
  7. Name
  8. ====
  9. media-close - Close a media 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 media device. Resources associated with the file descriptor
  22. are freed. The device configuration remain unchanged.
  23. Return Value
  24. ============
  25. :c:func:`close()` returns 0 on success. On error, -1 is returned, and
  26. ``errno`` is set appropriately. Possible error codes are:
  27. EBADF
  28. ``fd`` is not a valid open file descriptor.