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