tail head cat sleep
QR code linking to this page



openpam_readline – read a line from a file



#include <sys/types.h>
#include <stdio.h>
#include <security/pam_appl.h>
#include <security/openpam.h>

char *
openpam_readline(FILE *f, int *lineno, size_t *lenp);


This function is deprecated and may be removed in a future release without further warning. The openpam_readlinev() function may be used to achieve similar results.

The openpam_readline() function reads a line from a file, and returns it in a NUL-terminated buffer allocated with malloc(3).

The openpam_readline() function performs a certain amount of processing on the data it reads:

If lineno is not NULL, the integer variable it points to is incremented every time a newline character is read.

If lenp is not NULL, the length of the line (not including the terminating NUL character) is stored in the variable it points to.

The caller is responsible for releasing the returned buffer by passing it to free(3).


The openpam_readline() function returns NULL on failure.


openpam_readlinev(3), openpam_readword(3), pam(3)


The openpam_readline() function is an OpenPAM extension.


The openpam_readline() 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/orgrav <Mt des@des.no>.

OPENPAM_READLINE (3) February 24, 2019

tail head cat sleep
QR code linking to this page

Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

Unix...best if used before: Tue Jan 19 03:14:08 GMT 2038