libssh2
1.\" Copyright (C) The libssh2 project and its contributors.
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_session_last_error 3 "1 Jun 2007" "libssh2 0.15" "libssh2"
4.SH NAME
5libssh2_session_last_error - get the most recent error
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10int
11libssh2_session_last_error(LIBSSH2_SESSION *session,
12char **errmsg, int *errmsg_len, int want_buf);
13.fi
14.SH DESCRIPTION
15\fIsession\fP - Session instance as returned by
16.BR libssh2_session_init_ex(3)
17
18\fIerrmsg\fP - If not NULL, is populated by reference with the human
19readable form of the most recent error message.
20
21\fIerrmsg_len\fP - If not NULL, is populated by reference with the length
22of errmsg. (The string is NUL-terminated, so the length is only useful as
23an optimization, to avoid calling strlen.)
24
25\fIwant_buf\fP - If set to a non-zero value, "ownership" of the errmsg
26buffer will be given to the calling scope. If necessary, the errmsg buffer
27will be duplicated.
28
29Determine the most recent error condition and its cause.
30.SH RETURN VALUE
31Numeric error code corresponding to the the Error Code constants.
32.SH SEE ALSO
33.BR libssh2_session_last_errno(3)
34.BR libssh2_session_set_last_error(3)
35