---
name: "libssh2_session_last_errno"
section: "3"
platform: "linux"
package: "libssh2"
version: "1.11.1-7"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libssh2_session_last_errno"
---

# libssh2\_session\_last\_errno(3)

get the most recent error number

## NAME

libssh2\_session\_last\_errno - get the most recent error number

## SYNOPSIS

```
#include <libssh2.h>
int
libssh2_session_last_errno(LIBSSH2_SESSION *session);
```

## DESCRIPTION

*session* - Session instance as returned by **[libssh2\_session\_init\_ex(3)](/libssh2_session_init_ex/3.md)**

Determine the most recent error condition.

## RETURN VALUE

Numeric error code corresponding to the the Error Code constants.

## SEE ALSO

**[libssh2\_session\_last\_error(3)](/libssh2_session_last_error/3.md)** **[libssh2\_session\_set\_last\_error(3)](/libssh2_session_set_last_error/3.md)**
