---
name: "pam_end"
section: "3"
platform: "macos"
package: "OpenPAM"
version: "35"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_end"
---

# pam\_end(3)

terminate the PAM transaction

## NAME

**pam\_end** – terminate the PAM transaction

## LIBRARY

library “libpam”

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/pam\_appl.h\>**

*int*\

**pam\_end**(*pam\_handle\_t \*pamh*, *int status*);

## DESCRIPTION

The **pam\_end** function terminates a PAM transaction and destroys the corresponding PAM context, releasing all resources allocated to it.

The *status* argument should be set to the error code returned by the last API call before the call to **pam\_end**

## RETURN VALUES

The **pam\_end** function returns one of the following values:

- \[PAM\_SYSTEM\_ERR\]

  System error.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

*X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules*, June 1997.

## AUTHORS

The **pam\_end** function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.
