Merge tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / video-fopen.rst
1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _video_fopen:
11
12 ================
13 dvb video open()
14 ================
15
16 Name
17 ----
18
19 dvb video open()
20
21 .. attention:: This ioctl is deprecated.
22
23 Synopsis
24 --------
25
26 .. c:function:: int open(const char *deviceName, int flags)
27
28
29 Arguments
30 ---------
31
32 .. flat-table::
33     :header-rows:  0
34     :stub-columns: 0
35
36
37     -  .. row 1
38
39        -  const char \*deviceName
40
41        -  Name of specific video device.
42
43     -  .. row 2
44
45        -  int flags
46
47        -  A bit-wise OR of the following flags:
48
49     -  .. row 3
50
51        -
52        -  O_RDONLY read-only access
53
54     -  .. row 4
55
56        -
57        -  O_RDWR read/write access
58
59     -  .. row 5
60
61        -
62        -  O_NONBLOCK open in non-blocking mode
63
64     -  .. row 6
65
66        -
67        -  (blocking mode is the default)
68
69
70 Description
71 -----------
72
73 This system call opens a named video device (e.g.
74 /dev/dvb/adapter0/video0) for subsequent use.
75
76 When an open() call has succeeded, the device will be ready for use. The
77 significance of blocking or non-blocking mode is described in the
78 documentation for functions where there is a difference. It does not
79 affect the semantics of the open() call itself. A device opened in
80 blocking mode can later be put into non-blocking mode (and vice versa)
81 using the F_SETFL command of the fcntl system call. This is a standard
82 system call, documented in the Linux manual page for fcntl. Only one
83 user can open the Video Device in O_RDWR mode. All other attempts to
84 open the device in this mode will fail, and an error-code will be
85 returned. If the Video Device is opened in O_RDONLY mode, the only
86 ioctl call that can be used is VIDEO_GET_STATUS. All other call will
87 return an error code.
88
89
90 Return Value
91 ------------
92
93 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
94
95 .. flat-table::
96     :header-rows:  0
97     :stub-columns: 0
98
99
100     -  .. row 1
101
102        -  ``ENODEV``
103
104        -  Device driver not loaded/available.
105
106     -  .. row 2
107
108        -  ``EINTERNAL``
109
110        -  Internal error.
111
112     -  .. row 3
113
114        -  ``EBUSY``
115
116        -  Device or resource busy.
117
118     -  .. row 4
119
120        -  ``EINVAL``
121
122        -  Invalid argument.