1libssh2_channel_read_ex(3) libssh2 manual 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 libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int
12 stream_id, char *buf, size_t buflen);
13
14 ssize_t libssh2_channel_read(LIBSSH2_CHANNEL *channel, char *buf,
15 size_t buflen);
16
17 ssize_t libssh2_channel_read_stderr(LIBSSH2_CHANNEL *channel, char
18 *buf, size_t buflen);
19
20
22 Attempt to read data from an active channel stream. All channel streams
23 have one standard I/O substream (stream_id == 0), and may have up to
24 2^32 extended data streams as identified by the selected stream_id. The
25 SSH2 protocol currently defines a stream ID of 1 to be the stderr sub‐
26 stream.
27
28 channel - active channel stream to read from.
29
30 stream_id - substream ID number (e.g. 0 or SSH_EXTENDED_DATA_STDERR)
31
32 buf - pointer to storage buffer to read data into
33
34 buflen - size of the buf storage
35
36 libssh2_channel_read(3) and libssh2_channel_read_stderr(3) are macros.
37
39 Actual number of bytes read or negative on failure. It returns LIB‐
40 SSH2_ERROR_EAGAIN when it would otherwise block. While LIB‐
41 SSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per
42 se.
43
45 LIBSSH2_ERROR_SOCKET_SEND - Unable to send data on socket.
46
47 LIBSSH2_ERROR_CHANNEL_CLOSED - The channel has been closed.
48
49
51 libssh2_poll_channel_read(3)
52
53
54
55libssh2 0.15 1 Jun 2007 libssh2_channel_read_ex(3)