xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/dvb/dmx-fread.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun.. c:namespace:: DTV.dmx
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun.. _dmx_fread:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun=======================
7*4882a593SmuzhiyunDigital TV demux read()
8*4882a593Smuzhiyun=======================
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunName
11*4882a593Smuzhiyun----
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunDigital TV demux read()
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSynopsis
16*4882a593Smuzhiyun--------
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun.. c:function:: size_t read(int fd, void *buf, size_t count)
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunArguments
21*4882a593Smuzhiyun---------
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun``fd``
24*4882a593Smuzhiyun  File descriptor returned by a previous call to :c:func:`open()`.
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun ``buf``
27*4882a593Smuzhiyun   Buffer to be filled
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun``count``
30*4882a593Smuzhiyun   Max number of bytes to read
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunDescription
33*4882a593Smuzhiyun-----------
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunThis system call returns filtered data, which might be section or Packetized
36*4882a593SmuzhiyunElementary Stream (PES) data. The filtered data is transferred from
37*4882a593Smuzhiyunthe driver’s internal circular buffer to ``buf``. The maximum amount of data
38*4882a593Smuzhiyunto be transferred is implied by count.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun.. note::
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun   if a section filter created with
43*4882a593Smuzhiyun   :c:type:`DMX_CHECK_CRC <dmx_sct_filter_params>` flag set,
44*4882a593Smuzhiyun   data that fails on CRC check will be silently ignored.
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunReturn Value
47*4882a593Smuzhiyun------------
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunOn success 0 is returned.
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunOn error -1 is returned, and the ``errno`` variable is set
52*4882a593Smuzhiyunappropriately.
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun.. flat-table::
57*4882a593Smuzhiyun    :header-rows:  0
58*4882a593Smuzhiyun    :stub-columns: 0
59*4882a593Smuzhiyun    :widths: 1 16
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun    -  -  ``EWOULDBLOCK``
62*4882a593Smuzhiyun       -  No data to return and ``O_NONBLOCK`` was specified.
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun    -  -  ``EOVERFLOW``
65*4882a593Smuzhiyun       -  The filtered data was not read from the buffer in due time,
66*4882a593Smuzhiyun	  resulting in non-read data being lost. The buffer is flushed.
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun    -  -  ``ETIMEDOUT``
69*4882a593Smuzhiyun       -  The section was not loaded within the stated timeout period.
70*4882a593Smuzhiyun          See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun    -  -  ``EFAULT``
73*4882a593Smuzhiyun       -  The driver failed to write to the callers buffer due to an
74*4882a593Smuzhiyun          invalid \*buf pointer.
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunThe generic error codes are described at the
77*4882a593Smuzhiyun:ref:`Generic Error Codes <gen-errors>` chapter.
78