1libssh2_channel_read_ex(3) libssh2 libssh2_channel_read_ex(3)
2
3
4
6 libssh2_channel_read_ex - read data from a channel stream
7
9 #include <libssh2.h>
10
11 ssize_t
12 libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int stream_id,
13 char *buf, size_t buflen);
14
15 ssize_t
16 libssh2_channel_read(LIBSSH2_CHANNEL *channel,
17 char *buf, size_t buflen);
18
19 ssize_t
20 libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel,
21 char *buf, size_t buflen);
22
24 Attempt to read data from an active channel stream. All channel streams
25 have one standard I/O substream (stream_id == 0), and may have up to
26 2^32 extended data streams as identified by the selected stream_id. The
27 SSH2 protocol currently defines a stream ID of 1 to be the stderr sub‐
28 stream.
29
30 channel - active channel stream to read from.
31
32 stream_id - substream ID number (e.g. 0 or SSH_EXTENDED_DATA_STDERR)
33
34 buf - pointer to storage buffer to read data into
35
36 buflen - size of the buf storage
37
38 libssh2_channel_read(3) and libssh2_channel_read_stderr(3) are macros.
39
41 Actual number of bytes read or negative on failure. It returns LIB‐
42 SSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ER‐
43 ROR_EAGAIN is a negative number, it is not really a failure per se.
44
45 Note that a return value of zero (0) can in fact be a legitimate value
46 and only signals that no payload data was read. It is not an error.
47
49 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
50
51 LIBSSH2_ERROR_CHANNEL_CLOSED - The channel has been closed.
52
54 libssh2_poll_channel_read(3)
55
56
57
58libssh2 0.15 1 Jun 2007 libssh2_channel_read_ex(3)