Commit | Line | Data |
---|---|---|
5377d91f MH |
1 | .. -*- coding: utf-8; mode: rst -*- |
2 | ||
3 | .. _media-func-close: | |
4 | ||
5 | ************* | |
6 | media close() | |
7 | ************* | |
8 | ||
9 | *man media-close(2)* | |
10 | ||
11 | Close a media device | |
12 | ||
13 | ||
14 | Synopsis | |
15 | ======== | |
16 | ||
17 | .. code-block:: c | |
18 | ||
19 | #include <unistd.h> | |
20 | ||
21 | ||
22 | .. c:function:: int close( int fd ) | |
23 | ||
24 | Arguments | |
25 | ========= | |
26 | ||
27 | ``fd`` | |
28 | File descriptor returned by :ref:`open() <func-open>`. | |
29 | ||
30 | ||
31 | Description | |
32 | =========== | |
33 | ||
34 | Closes the media device. Resources associated with the file descriptor | |
35 | are freed. The device configuration remain unchanged. | |
36 | ||
37 | ||
38 | Return Value | |
39 | ============ | |
40 | ||
41 | :c:func:`close()` returns 0 on success. On error, -1 is returned, and | |
42 | ``errno`` is set appropriately. Possible error codes are: | |
43 | ||
44 | EBADF | |
45 | ``fd`` is not a valid open file descriptor. | |
46 | ||
47 | ||
48 | .. ------------------------------------------------------------------------------ | |
49 | .. This file was automatically converted from DocBook-XML with the dbxml | |
50 | .. library (https://github.com/return42/sphkerneldoc). The origin XML comes | |
51 | .. from the linux kernel, refer to: | |
52 | .. | |
53 | .. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook | |
54 | .. ------------------------------------------------------------------------------ |