Main index | Section 3 | Options |
#include <sys/types.h>
#include <security/pam_appl.h>
#include <security/openpam.h>
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.
OPENPAM_STRADDCH (3) | February 24, 2019 |
Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Like a classics radio station whose play list spans decades, Unix simultaneously exhibits its mixed and dated heritage. There's Clash-era graphics interfaces; Beatles-era two-letter command names; and systems programs (for example, ps) whose terse and obscure output was designed for slow teletypes; Bing Crosby-era command editing (# and @ are still the default line editing commands), and Scott Joplin-era core dumps. | ” |
— The Unix Haters' handbook |