summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-02-12 15:27:37 +0100
committerFlorian Weimer <fweimer@redhat.com>2020-02-13 09:14:40 +0100
commit499a92df8b9fc64a054cf3b7f728f8967fc1da7d (patch)
tree2ac72ff8eab1985d7162fd0fd23d18fd7375a0e5 /sysdeps/posix
parent8a9221415041543aa163071fa547e88138ceec9d (diff)
downloadglibc-499a92df8b9fc64a054cf3b7f728f8967fc1da7d.tar.gz
glibc-499a92df8b9fc64a054cf3b7f728f8967fc1da7d.tar.xz
glibc-499a92df8b9fc64a054cf3b7f728f8967fc1da7d.zip
nss: Add function types and NSS_DECLARE_MODULE_FUNCTIONS macro to <nss.h>
This macro allows to add type safety to the implementation of NSS
service modules.

Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 538691a598..ed04e564f9 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -300,18 +300,6 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
  }
 
 
-typedef enum nss_status (*nss_gethostbyname4_r)
-  (const char *name, struct gaih_addrtuple **pat,
-   char *buffer, size_t buflen, int *errnop,
-   int *h_errnop, int32_t *ttlp);
-typedef enum nss_status (*nss_gethostbyname3_r)
-  (const char *name, int af, struct hostent *host,
-   char *buffer, size_t buflen, int *errnop,
-   int *h_errnop, int32_t *ttlp, char **canonp);
-typedef enum nss_status (*nss_getcanonname_r)
-  (const char *name, char *buffer, size_t buflen, char **result,
-   int *errnop, int *h_errnop);
-
 /* This function is called if a canonical name is requested, but if
    the service function did not provide it.  It tries to obtain the
    name using getcanonname_r from the same service NIP.  If the name
@@ -321,7 +309,7 @@ typedef enum nss_status (*nss_getcanonname_r)
 static char *
 getcanonname (service_user *nip, struct gaih_addrtuple *at, const char *name)
 {
-  nss_getcanonname_r cfct = __nss_lookup_function (nip, "getcanonname_r");
+  nss_getcanonname_r *cfct = __nss_lookup_function (nip, "getcanonname_r");
   char *s = (char *) name;
   if (cfct != NULL)
     {
@@ -751,7 +739,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	  while (!no_more)
 	    {
 	      no_data = 0;
-	      nss_gethostbyname4_r fct4 = NULL;
+	      nss_gethostbyname4_r *fct4 = NULL;
 
 	      /* gethostbyname4_r sends out parallel A and AAAA queries and
 		 is thus only suitable for PF_UNSPEC.  */
@@ -827,7 +815,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		}
 	      else
 		{
-		  nss_gethostbyname3_r fct = NULL;
+		  nss_gethostbyname3_r *fct = NULL;
 		  if (req->ai_flags & AI_CANONNAME)
 		    /* No need to use this function if we do not look for
 		       the canonical name.  The function does not exist in