+2012-06-03 Bruno Haible <bruno@clisp.org>
+
+ error, strerror-override: Support new errno values from POSIX:2008.
+ * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Test also EOWNERDEAD and
+ ENOTRECOVERABLE.
+ * lib/errno.in.h (EOWNERDEAD, ENOTRECOVERABLE): Define on all
+ platforms.
+ * lib/strerror-override.c (strerror_override): Conditionalize the
+ EOWNERDEAD, ENOTRECOVERABLE handling on GNULIB_defined_EOWNERDEAD.
+ * lib/strerror-override.h (strerror_override): Declare also if
+ GNULIB_defined_EOWNERDEAD is defined.
+ * tests/test-errno.c (e130, e131): New variables.
+ * doc/posix-headers/errno.texi: Mention the status for EOWNERDEAD,
+ ENOTRECOVERABLE.
+ Reported by Paolo Bonzini.
+
2012-05-31 Jim Meyering <meyering@redhat.com>
savewd: add missing dependency on sys_wait module
@code{ETIMEDOUT}, @code{ECONNREFUSED}, @code{EHOSTUNREACH}, @code{EALREADY},
@code{EINPROGRESS} are not defined on some platforms:
mingw, MSVC 9.
+@item
+The macros @code{EOWNERDEAD}, @code{ENOTRECOVERABLE} are not defined on
+some platforms:
+glibc/Linux 2.3.6, glibc/Hurd 2.15, glibc/kFreeBSD 2.15,
+MacOS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, OSF/1 5.1, Cygwin, mingw without pthreads-win32, MSVC 9, Interix 3.5, BeOS.
@end itemize
Portability problems not fixed by Gnulib:
# define GNULIB_defined_ECANCELED 1
# endif
+# ifndef EOWNERDEAD
+# define EOWNERDEAD 133
+# define ENOTRECOVERABLE 127
+# define GNULIB_defined_EOWNERDEAD 1
+# endif
+
# ifndef EINPROGRESS
# define EINPROGRESS 112
# define EALREADY 103
# define ENODATA 120 /* not required by POSIX */
# define ENOSR 124 /* not required by POSIX */
# define ENOSTR 125 /* not required by POSIX */
-# define ENOTRECOVERABLE 127 /* not required by POSIX */
-# define EOWNERDEAD 133 /* not required by POSIX */
# define ETIME 137 /* not required by POSIX */
# define EOTHER 131 /* not required by POSIX */
# define GNULIB_defined_ESOCK 1
# define GNULIB_defined_ECANCELED 1
# endif
+/* On many platforms, the macros EOWNERDEAD and ENOTRECOVERABLE are not
+ defined. */
+
+# ifndef EOWNERDEAD
+# if defined __sun
+ /* Use the same values as defined for Solaris >= 8, for
+ interoperability. */
+# define EOWNERDEAD 58
+# define ENOTRECOVERABLE 59
+# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* We have a conflict here: pthreads-win32 defines these values
+ differently than MSVC 10. It's hairy to decide which one to use. */
+# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
+ /* Use the same values as defined by pthreads-win32, for
+ interoperability. */
+# define EOWNERDEAD 43
+# define ENOTRECOVERABLE 44
+# else
+ /* Use the same values as defined by MSVC 10, for
+ interoperability. */
+# define EOWNERDEAD 133
+# define ENOTRECOVERABLE 127
+# endif
+# else
+# define EOWNERDEAD 2013
+# define ENOTRECOVERABLE 2014
+# endif
+# define GNULIB_defined_EOWNERDEAD 1
+# endif
#endif /* _@GUARD_PREFIX@_ERRNO_H */
#endif /* _@GUARD_PREFIX@_ERRNO_H */
return "Out of streams resources";
case ENOSTR:
return "Device not a stream";
- case ENOTRECOVERABLE:
- return "State not recoverable";
- case EOWNERDEAD:
- return "Owner died";
case ETIME:
return "Timer expired";
case EOTHER:
return "Operation canceled";
#endif
+#if GNULIB_defined_EOWNERDEAD
+ case EOWNERDEAD:
+ return "Owner died";
+ case ENOTRECOVERABLE:
+ return "State not recoverable";
+#endif
+
default:
return NULL;
}
|| GNULIB_defined_ECONNABORTED \
|| GNULIB_defined_ESTALE \
|| GNULIB_defined_EDQUOT \
- || GNULIB_defined_ECANCELED
+ || GNULIB_defined_ECANCELED \
+ || GNULIB_defined_EOWNERDEAD
extern const char *strerror_override (int errnum);
# else
# define strerror_override(ignored) NULL
-# errno_h.m4 serial 10
+# errno_h.m4 serial 11
dnl Copyright (C) 2004, 2006, 2008-2012 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
#endif
#if !defined ECANCELED
booboo
+#endif
+#if !defined EOWNERDEAD
+booboo
+#endif
+#if !defined ENOTRECOVERABLE
+booboo
#endif
],
[gl_cv_header_errno_h_complete=no],
int e116 = ESTALE;
int e122 = EDQUOT;
int e125 = ECANCELED;
+int e130 = EOWNERDEAD;
+int e131 = ENOTRECOVERABLE;
/* Don't verify that these errno values are all different, except for possibly
EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has