Merge tag 'mailbox-v4.21' of git://git.linaro.org/landing-teams/working/fujitsu/integ...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / dmx-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 .. _dmx_fopen:
11
12 =======================
13 Digital TV demux open()
14 =======================
15
16 Name
17 ----
18
19 Digital TV demux open()
20
21
22 Synopsis
23 --------
24
25 .. c:function:: int open(const char *deviceName, int flags)
26     :name: dvb-dmx-open
27
28 Arguments
29 ---------
30
31 ``name``
32   Name of specific Digital TV demux device.
33
34 ``flags``
35   A bit-wise OR of the following flags:
36
37 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
38
39 .. flat-table::
40     :header-rows:  0
41     :stub-columns: 0
42     :widths: 1 16
43
44     -
45        - ``O_RDONLY``
46        - read-only access
47
48     -
49        - ``O_RDWR``
50        - read/write access
51
52     -
53        - ``O_NONBLOCK``
54        - open in non-blocking mode
55          (blocking mode is the default)
56
57
58 Description
59 -----------
60
61 This system call, used with a device name of ``/dev/dvb/adapter?/demux?``,
62 allocates a new filter and returns a handle which can be used for
63 subsequent control of that filter. This call has to be made for each
64 filter to be used, i.e. every returned file descriptor is a reference to
65 a single filter. ``/dev/dvb/adapter?/dvr?`` is a logical device to be used
66 for retrieving Transport Streams for digital video recording. When
67 reading from this device a transport stream containing the packets from
68 all PES filters set in the corresponding demux device
69 (``/dev/dvb/adapter?/demux?``) having the output set to ``DMX_OUT_TS_TAP``.
70 A recorded Transport Stream is replayed by writing to this device.
71
72 The significance of blocking or non-blocking mode is described in the
73 documentation for functions where there is a difference. It does not
74 affect the semantics of the ``open()`` call itself. A device opened
75 in blocking mode can later be put into non-blocking mode (and vice versa)
76 using the ``F_SETFL`` command of the fcntl system call.
77
78
79 Return Value
80 ------------
81
82 On success 0 is returned.
83
84 On error -1 is returned, and the ``errno`` variable is set
85 appropriately.
86
87 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
88
89 .. flat-table::
90     :header-rows:  0
91     :stub-columns: 0
92     :widths: 1 16
93
94     -  -  ``EMFILE``
95        -  “Too many open files”, i.e. no more filters available.
96
97 The generic error codes are described at the
98 :ref:`Generic Error Codes <gen-errors>` chapter.