]> Savannah Git Hosting - gnulib.git/commitdiff
netdb: Define NI_MAXHOST and NI_MAXSERV.
authorCollin Funk <collin.funk1@gmail.com>
Thu, 27 Jun 2024 07:50:16 +0000 (00:50 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Thu, 27 Jun 2024 07:50:16 +0000 (00:50 -0700)
* doc/posix-headers/netdb.texi (netdb.h): Document definitions that
differ from RFC 2553.
* lib/netdb.in.h (NI_MAXHOST, NI_MAXSERV): Define NI_MAXHOST and
NI_MAXSERV.

ChangeLog
doc/posix-headers/netdb.texi
lib/netdb.in.h

index c0526832f6d8eea649853448bf824f541edcc959..61a4bc1236dce3fd67e1bff6c9a938f4cde4676b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-06-27  Collin Funk  <collin.funk1@gmail.com>
+
+       netdb: Define NI_MAXHOST and NI_MAXSERV.
+       * doc/posix-headers/netdb.texi (netdb.h): Document definitions that
+       differ from RFC 2553.
+       * lib/netdb.in.h (NI_MAXHOST, NI_MAXSERV): Define NI_MAXHOST and
+       NI_MAXSERV.
+
 2024-06-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        strnlen: document Android bug
index 33631378a062f5a9c5a1c94766c92a18dd227a4c..47caaf8c3195746a8038cc9c5c744d999c07ba0e 100644 (file)
@@ -25,6 +25,12 @@ This header file does not define @code{AI_ADDRCONFIG} on some platforms:
 NetBSD 5.0.
 @end itemize
 
+@item
+@c Defined in RFC 2553.
+This header file incorrectly defines @code{NI_MAXHOST} on some platforms:
+musl libc 1.2.4, OpenBSD 7.5.
+@end
+
 Portability problems not fixed by Gnulib:
 @itemize
 @end itemize
index 43409b2f033c2b51d55da93e1d788f429bcabbe9..6267b544b0260c8724de82d4795696097ee49e3e 100644 (file)
 /* Declarations for a platform that lacks <netdb.h>, or where it is
    incomplete.  */
 
+/* Maximumn length of a fully-qualified domain name.  */
+#ifndef NI_MAXHOST
+# define NI_MAXHOST 1025
+#elif NI_MAXHOST != 1025
+# undef NI_MAXHOST
+# define NI_MAXHOST 1025
+#endif
+
+/* Maximumn length of a service.  */
+#ifndef NI_MAXSERV
+# define NI_MAXSERV 32
+#elif NI_MAXSERV != 32
+# undef NI_MAXSERV 32
+# define NI_MAXSERV 32
+#endif
+
 #if @GNULIB_GETADDRINFO@
 
 # if !@HAVE_STRUCT_ADDRINFO@