ca-fopen.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _ca_fopen:
  3. ====================
  4. Digital TV CA open()
  5. ====================
  6. Name
  7. ----
  8. Digital TV CA open()
  9. Synopsis
  10. --------
  11. .. c:function:: int open(const char *name, int flags)
  12. :name: dvb-ca-open
  13. Arguments
  14. ---------
  15. ``name``
  16. Name of specific Digital TV CA device.
  17. ``flags``
  18. A bit-wise OR of the following flags:
  19. .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
  20. .. flat-table::
  21. :header-rows: 0
  22. :stub-columns: 0
  23. :widths: 1 16
  24. - - ``O_RDONLY``
  25. - read-only access
  26. - - ``O_RDWR``
  27. - read/write access
  28. - - ``O_NONBLOCK``
  29. - open in non-blocking mode
  30. (blocking mode is the default)
  31. Description
  32. -----------
  33. This system call opens a named ca device (e.g. ``/dev/dvb/adapter?/ca?``)
  34. for subsequent use.
  35. When an ``open()`` call has succeeded, the device will be ready for use. The
  36. significance of blocking or non-blocking mode is described in the
  37. documentation for functions where there is a difference. It does not
  38. affect the semantics of the ``open()`` call itself. A device opened in
  39. blocking mode can later be put into non-blocking mode (and vice versa)
  40. using the ``F_SETFL`` command of the ``fcntl`` system call. This is a
  41. standard system call, documented in the Linux manual page for fcntl.
  42. Only one user can open the CA Device in ``O_RDWR`` mode. All other
  43. attempts to open the device in this mode will fail, and an error code
  44. will be returned.
  45. Return Value
  46. ------------
  47. On success 0 is returned.
  48. On error -1 is returned, and the ``errno`` variable is set
  49. appropriately.
  50. Generic error codes are described at the
  51. :ref:`Generic Error Codes <gen-errors>` chapter.