Merge tag 'uuid-for-4.14' of git://git.infradead.org/users/hch/uuid
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / dmx-fread.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _dmx_fread:
4
5 =======================
6 Digital TV demux read()
7 =======================
8
9 Name
10 ----
11
12 Digital TV demux read()
13
14
15 Synopsis
16 --------
17
18 .. c:function:: size_t read(int fd, void *buf, size_t count)
19     :name: dvb-dmx-read
20
21 Arguments
22 ---------
23
24 ``fd``
25   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
26
27  ``buf``
28    Buffer to be filled
29
30 ``count``
31    Max number of bytes to read
32
33 Description
34 -----------
35
36 This system call returns filtered data, which might be section or Packetized
37 Elementary Stream (PES) data. The filtered data is transferred from
38 the driver’s internal circular buffer to ``buf``. The maximum amount of data
39 to be transferred is implied by count.
40
41 .. note::
42
43    if a section filter created with
44    :c:type:`DMX_CHECK_CRC <dmx_sct_filter_params>` flag set,
45    data that fails on CRC check will be silently ignored.
46
47
48 Return Value
49 ------------
50
51 On success 0 is returned.
52
53 On error -1 is returned, and the ``errno`` variable is set
54 appropriately.
55
56 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
57
58 .. flat-table::
59     :header-rows:  0
60     :stub-columns: 0
61     :widths: 1 16
62
63     -  -  ``EWOULDBLOCK``
64        -  No data to return and ``O_NONBLOCK`` was specified.
65
66     -  -  ``EOVERFLOW``
67        -  The filtered data was not read from the buffer in due time,
68           resulting in non-read data being lost. The buffer is flushed.
69
70     -  -  ``ETIMEDOUT``
71        -  The section was not loaded within the stated timeout period.
72           See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
73
74     -  -  ``EFAULT``
75        -  The driver failed to write to the callers buffer due to an
76           invalid \*buf pointer.
77
78
79 The generic error codes are described at the
80 :ref:`Generic Error Codes <gen-errors>` chapter.