Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[deliverable/linux.git] / Documentation / media / uapi / rc / lirc-write.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
4ed030af 3.. _lirc-write:
5377d91f 4
8a6ba5c0
MCC
5************
6LIRC write()
7************
8
9Name
10====
11
12lirc-write - Write to a LIRC device
13
14
15Synopsis
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21
22
23.. cpp:function:: ssize_t write( int fd, void *buf, size_t count )
24
25
26Arguments
27=========
28
29``fd``
30 File descriptor returned by ``open()``.
31
32``buf``
33``count``
34
35
36Description
37===========
38
4ed030af 39:ref:`write() <lirc-write>` writes up to ``count`` bytes to the device
8a6ba5c0
MCC
40referenced by the file descriptor ``fd`` from the buffer starting at
41``buf``.
5377d91f
MH
42
43The data written to the chardev is a pulse/space sequence of integer
44values. Pulses and spaces are only marked implicitly by their position.
45The data must start and end with a pulse, therefore, the data must
46always include an uneven number of samples. The write function must
47block until the data has been transmitted by the hardware. If more data
cdb4af0f 48is provided than the hardware can send, the driver returns ``EINVAL``.
8a6ba5c0
MCC
49
50
51Return Value
52============
53
54On success, the number of bytes read is returned. It is not an error if
55this number is smaller than the number of bytes requested, or the amount
56of data required for one frame. On error, -1 is returned, and the ``errno``
57variable is set appropriately. The generic error codes are described at the
58:ref:`Generic Error Codes <gen-errors>` chapter.
This page took 0.044423 seconds and 5 git commands to generate.