Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _media-func-close: | |
4 | ||
5 | ************* | |
6 | media close() | |
7 | ************* | |
8 | ||
15e7d615 | 9 | Name |
586027ce | 10 | ==== |
5377d91f | 11 | |
586027ce | 12 | media-close - Close a media device |
5377d91f | 13 | |
15e7d615 MCC |
14 | |
15 | Synopsis | |
5377d91f MH |
16 | ======== |
17 | ||
18 | .. code-block:: c | |
19 | ||
20 | #include <unistd.h> | |
21 | ||
22 | ||
b7e67f6c | 23 | .. cpp:function:: int close( int fd ) |
5377d91f | 24 | |
586027ce | 25 | |
15e7d615 | 26 | Arguments |
5377d91f MH |
27 | ========= |
28 | ||
29 | ``fd`` | |
30 | File descriptor returned by :ref:`open() <func-open>`. | |
31 | ||
32 | ||
15e7d615 | 33 | Description |
5377d91f MH |
34 | =========== |
35 | ||
36 | Closes the media device. Resources associated with the file descriptor | |
37 | are freed. The device configuration remain unchanged. | |
38 | ||
39 | ||
15e7d615 | 40 | Return Value |
5377d91f MH |
41 | ============ |
42 | ||
8c1cc62a | 43 | :ref:`close() <media-func-close>` returns 0 on success. On error, -1 is returned, and |
5377d91f MH |
44 | ``errno`` is set appropriately. Possible error codes are: |
45 | ||
46 | EBADF | |
47 | ``fd`` is not a valid open file descriptor. |