GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  OPENPAM_STRADDCH (3)

NAME

openpam_straddch - add a character to a string, expanding the buffer if needed

CONTENTS

Library
Synopsis
Description
Return Values
See Also
Standards
Authors

LIBRARY


.Lb libpam

SYNOPSIS


.In sys/types.h
.In security/pam_appl.h
.In security/openpam.h int openpam_straddch char **str size_t *size size_t *len int ch

DESCRIPTION

The openpam_straddch function appends a character to a dynamically allocated NUL-terminated buffer, reallocating the buffer as needed.

The str argument points to a variable containing either a pointer to an existing buffer or NULL. If the value of the variable pointed to by str is NULL, a new buffer is allocated.

The size and len argument point to variables used to hold the size of the buffer and the length of the string it contains, respectively.

The final argument, ch, is the character that should be appended to the string. If ch is 0, nothing is appended, but a new buffer is still allocated if str is NULL. This can be used to " bootstrap " the string.

If a new buffer is allocated or an existing buffer is reallocated to make room for the additional character, str and size are updated accordingly.

The openpam_straddch function ensures that the buffer is always NUL-terminated.

If the openpam_straddch function is successful, it increments the integer variable pointed to by len (unless ch was 0) and returns 0. Otherwise, it leaves the variables pointed to by str, size and len unmodified, sets errno to ENOMEM and returns -1.

RETURN VALUES

The openpam_straddch function returns 0 on success and -1 on failure.

SEE ALSO

pam(3), pam_strerror(3)

STANDARDS

The openpam_straddch function is an OpenPAM extension.

AUTHORS

The openpam_straddch function and this manual page were developed by
.An Dag-Erling Sm\(/orgrav Aq des@des.no .
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.