This specific code does not work, from pam.c:
int result = pam_start(SERVICE_NAME, username, NULL, &pam_handle);
if (result != PAM_SUCCESS) {
printf("err %d", result);
err("pam_start...");
}
It always return:
pam_start: System error
I have checked and the openpam-20200510p0 is installed in my computer, OpenBSD 7.3 amd64