From daf7f8c02242c535d596231e2f655109b97fa2bc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 1 Nov 2012 15:29:14 -0700 Subject: [PATCH] errno: port to LynxOS 178 2.2.2 Problem reported by Joel Brobecker in . * doc/posix-headers/errno.texi (errno.h): Document this. * lib/errno.in.h (EILSEQ, GNULIB_defined_EILSEQ) [!EILSEQ]: New macros. * lib/strerror-override.c, lib/strerror-override.h (strerror_override): Supply a string for EILSEQ. * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Check for EILSEQ. --- ChangeLog | 11 +++++++++++ doc/posix-headers/errno.texi | 3 +++ lib/errno.in.h | 5 +++++ lib/strerror-override.c | 5 +++++ lib/strerror-override.h | 3 ++- m4/errno_h.m4 | 5 ++++- 6 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3576e7a2b..adcb8d111 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2012-11-05 Paul Eggert + errno: port to LynxOS 178 2.2.2 + Problem reported by Joel Brobecker in + . + * doc/posix-headers/errno.texi (errno.h): Document this. + * lib/errno.in.h (EILSEQ, GNULIB_defined_EILSEQ) [!EILSEQ]: New macros. + * lib/strerror-override.c, lib/strerror-override.h (strerror_override): + Supply a string for EILSEQ. + * m4/errno_h.m4 (gl_HEADER_ERRNO_H): Check for EILSEQ. + +2012-11-05 Paul Eggert + fcntl-h: default O_SEARCH, O_EXEC to O_PATH if available Linux kernel 2.6.39 introduced O_PATH (see ) and this is a better fallback diff --git a/doc/posix-headers/errno.texi b/doc/posix-headers/errno.texi index 54e0249b2..0166ddc64 100644 --- a/doc/posix-headers/errno.texi +++ b/doc/posix-headers/errno.texi @@ -42,6 +42,9 @@ 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, Mac OS 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. +@item +The macro @code{EILSEQ} is not defined on some platforms: +LynxOS 178 2.2.2. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/errno.in.h b/lib/errno.in.h index 4fba101c0..ec18b41ac 100644 --- a/lib/errno.in.h +++ b/lib/errno.in.h @@ -270,5 +270,10 @@ # define GNULIB_defined_ENOTRECOVERABLE 1 # endif +# ifndef EILSEQ +# define EILSEQ 2015 +# define GNULIB_defined_EILSEQ 1 +# endif + #endif /* _@GUARD_PREFIX@_ERRNO_H */ #endif /* _@GUARD_PREFIX@_ERRNO_H */ diff --git a/lib/strerror-override.c b/lib/strerror-override.c index 9f55cfa9a..f7cac65f7 100644 --- a/lib/strerror-override.c +++ b/lib/strerror-override.c @@ -291,6 +291,11 @@ strerror_override (int errnum) return "State not recoverable"; #endif +#if GNULIB_defined_EILSEQ + case EILSEQ: + return "Invalid or incomplete multibyte or wide character"; +#endif + default: return NULL; } diff --git a/lib/strerror-override.h b/lib/strerror-override.h index fe1fb2c22..646868136 100644 --- a/lib/strerror-override.h +++ b/lib/strerror-override.h @@ -46,7 +46,8 @@ || GNULIB_defined_EDQUOT \ || GNULIB_defined_ECANCELED \ || GNULIB_defined_EOWNERDEAD \ - || GNULIB_defined_ENOTRECOVERABLE + || GNULIB_defined_ENOTRECOVERABLE \ + || GNULIB_defined_EILSEQ extern const char *strerror_override (int errnum); # else # define strerror_override(ignored) NULL diff --git a/m4/errno_h.m4 b/m4/errno_h.m4 index 1e76ba270..4e33ba853 100644 --- a/m4/errno_h.m4 +++ b/m4/errno_h.m4 @@ -1,4 +1,4 @@ -# errno_h.m4 serial 11 +# errno_h.m4 serial 12 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, @@ -58,6 +58,9 @@ booboo #if !defined ENOTRECOVERABLE booboo #endif +#if !defined EILSEQ +booboo +#endif ], [gl_cv_header_errno_h_complete=no], [gl_cv_header_errno_h_complete=yes]) -- 2.11.0