doc-rst: standard: read the example captions
[deliverable/linux.git] / Documentation / linux_tv / media / v4l / media-func-open.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _media-func-open:
4
5************
6media open()
7************
8
9*man media-open(2)*
10
11Open a media device
12
13
14Synopsis
15========
16
17.. code-block:: c
18
19 #include <fcntl.h>
20
21
22.. c:function:: int open( const char *device_name, int flags )
23
24Arguments
25=========
26
27``device_name``
28 Device to be opened.
29
30``flags``
31 Open flags. Access mode must be either ``O_RDONLY`` or ``O_RDWR``.
32 Other flags have no effect.
33
34
35Description
36===========
37
38To open a media device applications call :c:func:`open()` with the
39desired device name. The function has no side effects; the device
40configuration remain unchanged.
41
42When the device is opened in read-only mode, attempts to modify its
43configuration will result in an error, and ``errno`` will be set to
44EBADF.
45
46
47Return Value
48============
49
50:c:func:`open()` returns the new file descriptor on success. On error,
51-1 is returned, and ``errno`` is set appropriately. Possible error codes
52are:
53
54EACCES
55 The requested access to the file is not allowed.
56
57EMFILE
58 The process already has the maximum number of files open.
59
60ENFILE
61 The system limit on the total number of open files has been reached.
62
63ENOMEM
64 Insufficient kernel memory was available.
65
66ENXIO
67 No device corresponding to this device special file exists.
68
69
70.. ------------------------------------------------------------------------------
71.. This file was automatically converted from DocBook-XML with the dbxml
72.. library (https://github.com/return42/sphkerneldoc). The origin XML comes
73.. from the linux kernel, refer to:
74..
75.. * https://github.com/torvalds/linux/tree/master/Documentation/DocBook
76.. ------------------------------------------------------------------------------
This page took 0.037072 seconds and 5 git commands to generate.