# info > pam_get_data

---
type: CommandReference
command: pam_get_data
mode: man
section: 3
source: man-pages
---

## Quick Reference

- `pam_get_data(pamh, "name", &data)` — retrieve module-specific data from PAM handle

## Name

pam_get_data - get module internal data

## Synopsis

c
#include <security/pam_modules.h>
int pam_get_data(const pam_handle_t *pamh, const char *module_data_name, const void **data);
## Options

- `pamh` — PAM handle
- `module_data_name` — unique string identifier for the data
- `data` — pointer to location where retrieved data pointer will be stored (constant data)

The function retrieves the object associated with the unique string `module_data_name` in the PAM context specified by `pamh`. A successful call results in `data` pointing to the object. The object is not a copy and should be treated as constant by the module.

## See Also

- [pam_end(3)](http://localhost/phpMan.php/man/pamend/3/markdown)
- [pam_set_data(3)](http://localhost/phpMan.php/man/pamsetdata/3/markdown)
- [pam_strerror(3)](http://localhost/phpMan.php/man/pamstrerror/3/markdown)

## Exit Codes

- `PAM_SUCCESS` — Data was successfully retrieved.
- `PAM_SYSTEM_ERR` — A NULL pointer was submitted as PAM handle or the function was called by an application.
- `PAM_NO_MODULE_DATA` — Module data not found or there is an entry, but it has the value NULL.