libssh2
1.\" Copyright (C) The libssh2 project and its contributors.
2.\" SPDX-License-Identifier: BSD-3-Clause
3.TH libssh2_session_set_last_error 3 "26 Oct 2015" "libssh2" "libssh2"
4.SH NAME
5libssh2_session_set_last_error - sets the internal error state
6.SH SYNOPSIS
7.nf
8#include <libssh2.h>
9
10int
11libssh2_session_set_last_error(LIBSSH2_SESSION *session,
12int errcode, const char *errmsg)
13.fi
14.SH DESCRIPTION
15\fIsession\fP - Session instance as returned by
16.BR libssh2_session_init_ex(3)
17
18\fIerrcode\fP - One of the error codes as defined in the public
19libssh2 header file.
20
21\fIerrmsg\fP - If not NULL, a copy of the given string is stored
22inside the session object as the error message.
23
24This function is provided for high level language wrappers
25(i.e. Python or Perl) and other libraries that may extend libssh2 with
26additional features while still relying on its error reporting
27mechanism.
28.SH RETURN VALUE
29Numeric error code corresponding to the the Error Code constants.
30.SH AVAILABILITY
31Added in 1.6.1
32.SH SEE ALSO
33.BR libssh2_session_last_error(3)
34.BR libssh2_session_last_errno(3)
35