Merge tag 'nfs-for-4.21-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
[sfrench/cifs-2.6.git] / Documentation / media / uapi / dvb / ca-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 .. _ca_fopen:
11
12 ====================
13 Digital TV CA open()
14 ====================
15
16 Name
17 ----
18
19 Digital TV CA open()
20
21
22 Synopsis
23 --------
24
25 .. c:function:: int open(const char *name, int flags)
26     :name: dvb-ca-open
27
28
29 Arguments
30 ---------
31
32 ``name``
33   Name of specific Digital TV CA device.
34
35 ``flags``
36   A bit-wise OR of the following flags:
37
38 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
39
40 .. flat-table::
41     :header-rows:  0
42     :stub-columns: 0
43     :widths: 1 16
44
45     -  - ``O_RDONLY``
46        - read-only access
47
48     -  - ``O_RDWR``
49        - read/write access
50
51     -  - ``O_NONBLOCK``
52        - open in non-blocking mode
53          (blocking mode is the default)
54
55
56 Description
57 -----------
58
59 This system call opens a named ca device (e.g. ``/dev/dvb/adapter?/ca?``)
60 for subsequent use.
61
62 When an ``open()`` call has succeeded, the device will be ready for use. The
63 significance of blocking or non-blocking mode is described in the
64 documentation for functions where there is a difference. It does not
65 affect the semantics of the ``open()`` call itself. A device opened in
66 blocking mode can later be put into non-blocking mode (and vice versa)
67 using the ``F_SETFL`` command of the ``fcntl`` system call. This is a
68 standard system call, documented in the Linux manual page for fcntl.
69 Only one user can open the CA Device in ``O_RDWR`` mode. All other
70 attempts to open the device in this mode will fail, and an error code
71 will be returned.
72
73
74 Return Value
75 ------------
76
77
78 On success 0 is returned.
79
80 On error -1 is returned, and the ``errno`` variable is set
81 appropriately.
82
83 Generic error codes are described at the
84 :ref:`Generic Error Codes <gen-errors>` chapter.