---
name: "pam_vprompt"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_vprompt"
---

# pam\_vprompt(3)

call the conversation function

## NAME

**pam\_vprompt** – call the conversation function

## SYNOPSIS

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

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

*int*\

**pam\_vprompt**(*const pam\_handle\_t \*pamh*, *int style*, *char \*\*resp*, *const char \*fmt*, *va\_list ap*);

## DESCRIPTION

The **pam\_vprompt**() function constructs a string from the *fmt* and *ap* arguments using [vsnprintf(3)](/vsnprintf/3.md), and passes it to the given PAM context's conversation function.

The *style* argument specifies the type of interaction requested, and must be one of the following:

- PAM\_PROMPT\_ECHO\_OFF

  Display the message and obtain the user's response without displaying it.

- PAM\_PROMPT\_ECHO\_ON

  Display the message and obtain the user's response.

- PAM\_ERROR\_MSG

  Display the message as an error message, and do not wait for a response.

- PAM\_TEXT\_INFO

  Display the message as an informational message, and do not wait for a response.

A pointer to the response, or NULL if the conversation function did not return one, is stored in the location pointed to by the *resp* argument.

The message and response should not exceed PAM\_MAX\_MSG\_SIZE or PAM\_MAX\_RESP\_SIZE, respectively. If they do, they may be truncated.

## RETURN VALUES

The **pam\_vprompt**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_BUF\_ERR\]

  Memory buffer error.

- \[PAM\_CONV\_ERR\]

  Conversation failure.

- \[PAM\_SYSTEM\_ERR\]

  System error.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_error(3)](/pam_error/3.md), [pam\_info(3)](/pam_info/3.md), [pam\_prompt(3)](/pam_prompt/3.md), [pam\_strerror(3)](/pam_strerror/3.md), [pam\_verror(3)](/pam_verror/3.md), [pam\_vinfo(3)](/pam_vinfo/3.md), [vsnprintf(3)](/vsnprintf/3.md)

## STANDARDS

The **pam\_vprompt**() function is an OpenPAM extension.

## AUTHORS

The **pam\_vprompt**() 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.

The OpenPAM library is maintained by Dag-Erling Smørgrav ⟨*des@des.dev*⟩.
