see: https://www.illumos.org/issues/15657
struct pam_message in struct pam_conv is not const in illumos

--- postgresql-16.2/src/backend/libpq/auth.c.orig	2024-02-05 22:41:37.000000000 +0100
+++ postgresql-16.2/src/backend/libpq/auth.c	2024-03-02 16:24:39.679182959 +0100
@@ -96,7 +96,7 @@
 #define PGSQL_PAM_SERVICE "postgresql"	/* Service name passed to PAM */
 
 static int	CheckPAMAuth(Port *port, const char *user, const char *password);
-static int	pam_passwd_conv_proc(int num_msg, const struct pam_message **msg,
+static int	pam_passwd_conv_proc(int num_msg, struct pam_message **msg,
 								 struct pam_response **resp, void *appdata_ptr);
 
 static struct pam_conv pam_passw_conv = {
@@ -1910,7 +1910,7 @@
  */
 
 static int
-pam_passwd_conv_proc(int num_msg, const struct pam_message **msg,
+pam_passwd_conv_proc(int num_msg, struct pam_message **msg,
 					 struct pam_response **resp, void *appdata_ptr)
 {
 	const char *passwd;