]> Savannah Git Hosting - gnulib.git/commitdiff
errno: Ensure ESOCKTNOSUPPORT gets defined.
authorBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 15:11:35 +0000 (17:11 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 15:13:25 +0000 (17:13 +0200)
* m4/errno_h.m4 (gl_HEADER_ERRNO_H): Test also whether ESOCKTNOSUPPORT
is defined.
* lib/errno.in.h (ESOCKTNOSUPPORT, GNULIB_defined_ESOCKTNOSUPPORT): New
macros.
* lib/strerror-override.h (strerror_override): Declare also if
GNULIB_defined_ESOCKTNOSUPPORT is defined.
* lib/strerror-override.c (strerror_override): Handle ESOCKTNOSUPPORT.
* lib/strerrorname_np.c (strerrorname_np): Move ESOCKTNOSUPPORT code to
the POSIX section.
* doc/posix-headers/errno.texi: Document the Haiku problem.

ChangeLog
doc/posix-headers/errno.texi
lib/errno.in.h
lib/strerror-override.c
lib/strerror-override.h
lib/strerrorname_np.c
m4/errno_h.m4

index 16df685b976079c1efae6bb377b4a0fe4611ea53..c4dda29205922a3b63593b601cbca1d7254c7cf3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-08-12  Bruno Haible  <bruno@clisp.org>
+
+       errno: Ensure ESOCKTNOSUPPORT gets defined.
+       * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Test also whether ESOCKTNOSUPPORT
+       is defined.
+       * lib/errno.in.h (ESOCKTNOSUPPORT, GNULIB_defined_ESOCKTNOSUPPORT): New
+       macros.
+       * lib/strerror-override.h (strerror_override): Declare also if
+       GNULIB_defined_ESOCKTNOSUPPORT is defined.
+       * lib/strerror-override.c (strerror_override): Handle ESOCKTNOSUPPORT.
+       * lib/strerrorname_np.c (strerrorname_np): Move ESOCKTNOSUPPORT code to
+       the POSIX section.
+       * doc/posix-headers/errno.texi: Document the Haiku problem.
+
 2024-08-12  Bruno Haible  <bruno@clisp.org>
 
        fdutimensat, utimensat tests: Fix test failures on Cygwin.
index 83a31f4fb4034fd5a4f5738b7cdc77859373c5a0..4495fbfaeeb18a43226f22275738e2ffdc74cdd0 100644 (file)
@@ -51,6 +51,9 @@ some platforms:
 glibc/Linux 2.3.6, glibc/Hurd 2.15, glibc/kFreeBSD 2.15,
 Mac OS X 10.5, FreeBSD 6.0, NetBSD 9.3, OpenBSD 6.0, Minix 3.1.8, AIX 5.1, HP-UX 11, Cygwin, mingw without pthreads-win32, MSVC 9.
 @item
+The macro @code{ESOCKTNOSUPPORT} is not defined on some platforms:
+Haiku.
+@item
 The macro @code{EILSEQ} is not defined on some platforms:
 LynxOS 178 2.2.2.
 @item
index ba927037f616b06c1805b382da023f8b5a6aa055..18eb8a0c58222bd3c717fefc3558696441ccc237 100644 (file)
 #  define GNULIB_defined_ENOTRECOVERABLE 1
 # endif
 
+/* On LynxOS, the macro EILSEQ is not defined.  */
 # ifndef EILSEQ
 #  define EILSEQ 2015
 #  define GNULIB_defined_EILSEQ 1
 # endif
 
+/* On Haiku, the macro ESOCKTNOSUPPORT is not defined.  */
+# ifndef ESOCKTNOSUPPORT
+#  define ESOCKTNOSUPPORT 2016
+#  define GNULIB_defined_ESOCKTNOSUPPORT 1
+# endif
+
 #endif /* _@GUARD_PREFIX@_ERRNO_H */
 #endif /* _@GUARD_PREFIX@_ERRNO_H */
index b9c1c7aba83ebd6a6bdec0a7c7de6e1bcbec94dc..2d9560f909a26b7268f32607140a9f449d0aede9 100644 (file)
@@ -298,6 +298,11 @@ strerror_override (int errnum)
       return "Invalid or incomplete multibyte or wide character";
 # endif
 
+# if GNULIB_defined_ESOCKTNOSUPPORT
+    case ESOCKTNOSUPPORT:
+      return "Socket type not supported";
+# endif
+
     default:
       return NULL;
     }
index a1734a242e6639e4f204dbc172e87a90a82cd629..c496000389983a6dbe1d2e98370842b42b471366 100644 (file)
@@ -57,7 +57,8 @@ extern "C" {
     || GNULIB_defined_ECANCELED \
     || GNULIB_defined_EOWNERDEAD \
     || GNULIB_defined_ENOTRECOVERABLE \
-    || GNULIB_defined_EILSEQ
+    || GNULIB_defined_EILSEQ \
+    || GNULIB_defined_ESOCKTNOSUPPORT
 extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
 #else
 # define strerror_override(ignored) NULL
index 5a9390616258e715af81a7efeb65c8d3d948966a..f9f7cb702b7cbb0e7993ac0310852f8f6ac71ea6 100644 (file)
@@ -34,7 +34,7 @@ strerrorname_np (int errnum)
     case ERANGE:          return "ERANGE";
 
     /* Error codes specified by POSIX.
-       <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html>  */
+       <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/errno.h.html>  */
     #if defined E2BIG
     case E2BIG:           return "E2BIG";
     #endif
@@ -245,6 +245,9 @@ strerrorname_np (int errnum)
     #if defined EROFS
     case EROFS:           return "EROFS";
     #endif
+    #if defined ESOCKTNOSUPPORT
+    case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
+    #endif
     #if defined ESPIPE
     case ESPIPE:          return "ESPIPE";
     #endif
@@ -1279,10 +1282,6 @@ strerrorname_np (int errnum)
     #if defined ESIGPARM
     case ESIGPARM:        return "ESIGPARM";
     #endif
-    /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, AIX, HP-UX, IRIX, OSF/1, Solaris, Minix, Cygwin */
-    #if defined ESOCKTNOSUPPORT
-    case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
-    #endif
     /* AIX, OSF/1 */
     #if defined ESOFT
     case ESOFT:           return "ESOFT";
index 18bfd7b1c127fd8ebc6ebe530585d3a533210958..920ea6cc65374a4926026cf2ddd21a125c948cbd 100644 (file)
@@ -1,5 +1,5 @@
 # errno_h.m4
-# serial 17
+# serial 18
 dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -68,6 +68,9 @@ booboo
 #endif
 #if !defined EILSEQ
 booboo
+#endif
+#if !defined ESOCKTNOSUPPORT
+booboo
 #endif
       ],
       [gl_cv_header_errno_h_complete=no],