1 .. -*- coding: utf-8; mode: rst -*-
18 This system call opens a named ca device (e.g. /dev/ost/ca) for
21 When an open() call has succeeded, the device will be ready for use. The
22 significance of blocking or non-blocking mode is described in the
23 documentation for functions where there is a difference. It does not
24 affect the semantics of the open() call itself. A device opened in
25 blocking mode can later be put into non-blocking mode (and vice versa)
26 using the F_SETFL command of the fcntl system call. This is a standard
27 system call, documented in the Linux manual page for fcntl. Only one
28 user can open the CA Device in O_RDWR mode. All other attempts to open
29 the device in this mode will fail, and an error code will be returned.
34 .. cpp:function:: int open(const char *deviceName, int flags)
48 - const char \*deviceName
50 - Name of specific video device.
56 - A bit-wise OR of the following flags:
61 - O_RDONLY read-only access
66 - O_RDWR read/write access
71 - O_NONBLOCK open in non-blocking mode
76 - (blocking mode is the default)
93 - Device driver not loaded/available.
105 - Device or resource busy.
123 This system call closes a previously opened audio device.
128 .. cpp:function:: int close(int fd)
144 - File descriptor returned by a previous call to open().
161 - fd is not a valid open file descriptor.
173 This ioctl is undocumented. Documentation is welcome.
178 .. cpp:function:: int ioctl(fd, int request = CA_RESET)
194 - File descriptor returned by a previous call to open().
200 - Equals CA_RESET for this command.
206 On success 0 is returned, on error -1 and the ``errno`` variable is set
207 appropriately. The generic error codes are described at the
208 :ref:`Generic Error Codes <gen-errors>` chapter.
219 This ioctl is undocumented. Documentation is welcome.
224 .. cpp:function:: int ioctl(fd, int request = CA_GET_CAP, ca_caps_t *)
240 - File descriptor returned by a previous call to open().
246 - Equals CA_GET_CAP for this command.
258 On success 0 is returned, on error -1 and the ``errno`` variable is set
259 appropriately. The generic error codes are described at the
260 :ref:`Generic Error Codes <gen-errors>` chapter.
263 .. _CA_GET_SLOT_INFO:
271 This ioctl is undocumented. Documentation is welcome.
276 .. cpp:function:: int ioctl(fd, int request = CA_GET_SLOT_INFO, ca_slot_info_t *)
292 - File descriptor returned by a previous call to open().
298 - Equals CA_GET_SLOT_INFO for this command.
310 On success 0 is returned, on error -1 and the ``errno`` variable is set
311 appropriately. The generic error codes are described at the
312 :ref:`Generic Error Codes <gen-errors>` chapter.
315 .. _CA_GET_DESCR_INFO:
323 This ioctl is undocumented. Documentation is welcome.
328 .. cpp:function:: int ioctl(fd, int request = CA_GET_DESCR_INFO, ca_descr_info_t *)
344 - File descriptor returned by a previous call to open().
350 - Equals CA_GET_DESCR_INFO for this command.
362 On success 0 is returned, on error -1 and the ``errno`` variable is set
363 appropriately. The generic error codes are described at the
364 :ref:`Generic Error Codes <gen-errors>` chapter.
375 This ioctl is undocumented. Documentation is welcome.
380 .. cpp:function:: int ioctl(fd, int request = CA_GET_MSG, ca_msg_t *)
396 - File descriptor returned by a previous call to open().
402 - Equals CA_GET_MSG for this command.
414 On success 0 is returned, on error -1 and the ``errno`` variable is set
415 appropriately. The generic error codes are described at the
416 :ref:`Generic Error Codes <gen-errors>` chapter.
427 This ioctl is undocumented. Documentation is welcome.
432 .. cpp:function:: int ioctl(fd, int request = CA_SEND_MSG, ca_msg_t *)
448 - File descriptor returned by a previous call to open().
454 - Equals CA_SEND_MSG for this command.
466 On success 0 is returned, on error -1 and the ``errno`` variable is set
467 appropriately. The generic error codes are described at the
468 :ref:`Generic Error Codes <gen-errors>` chapter.
479 This ioctl is undocumented. Documentation is welcome.
484 .. cpp:function:: int ioctl(fd, int request = CA_SET_DESCR, ca_descr_t *)
500 - File descriptor returned by a previous call to open().
506 - Equals CA_SET_DESCR for this command.
518 On success 0 is returned, on error -1 and the ``errno`` variable is set
519 appropriately. The generic error codes are described at the
520 :ref:`Generic Error Codes <gen-errors>` chapter.
531 This ioctl is undocumented. Documentation is welcome.
536 .. cpp:function:: int ioctl(fd, int request = CA_SET_PID, ca_pid_t *)
552 - File descriptor returned by a previous call to open().
558 - Equals CA_SET_PID for this command.
570 On success 0 is returned, on error -1 and the ``errno`` variable is set
571 appropriately. The generic error codes are described at the
572 :ref:`Generic Error Codes <gen-errors>` chapter.