about summary refs log tree commit diff
path: root/sysdeps/gnu/errlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/gnu/errlist.c')
-rw-r--r--sysdeps/gnu/errlist.c291
1 files changed, 149 insertions, 142 deletions
diff --git a/sysdeps/gnu/errlist.c b/sysdeps/gnu/errlist.c
index 6b7b4d4f6b..e6ca78d33a 100644
--- a/sysdeps/gnu/errlist.c
+++ b/sysdeps/gnu/errlist.c
@@ -4,9 +4,14 @@
 
 #ifndef SYS_ERRLIST
 # define SYS_ERRLIST _sys_errlist
+# define SYS_ERRLIST_ALIAS sys_errlist
 #endif
 #ifndef SYS_NERR
 # define SYS_NERR _sys_nerr
+# define SYS_NERR_ALIAS sys_nerr
+#endif
+#ifndef ERR_REMAP
+# define ERR_REMAP(n) n
 #endif
 
 const char *const SYS_ERRLIST[] =
@@ -16,19 +21,19 @@ const char *const SYS_ERRLIST[] =
 /*
 TRANS Operation not permitted; only the owner of the file (or other resource)
 TRANS or processes with special privileges can perform the operation. */
-    [EPERM] = N_("Operation not permitted"),
+    [ERR_REMAP (EPERM)] = N_("Operation not permitted"),
 #endif
 #ifdef ENOENT
 /*
 TRANS No such file or directory.  This is a ``file doesn't exist'' error
 TRANS for ordinary files that are referenced in contexts where they are
 TRANS expected to already exist. */
-    [ENOENT] = N_("No such file or directory"),
+    [ERR_REMAP (ENOENT)] = N_("No such file or directory"),
 #endif
 #ifdef ESRCH
 /*
 TRANS No process matches the specified process ID. */
-    [ESRCH] = N_("No such process"),
+    [ERR_REMAP (ESRCH)] = N_("No such process"),
 #endif
 #ifdef EINTR
 /*
@@ -39,12 +44,12 @@ TRANS
 TRANS You can choose to have functions resume after a signal that is handled,
 TRANS rather than failing with @code{EINTR}; see @ref{Interrupted
 TRANS Primitives}. */
-    [EINTR] = N_("Interrupted system call"),
+    [ERR_REMAP (EINTR)] = N_("Interrupted system call"),
 #endif
 #ifdef EIO
 /*
 TRANS Input/output error; usually used for physical read or write errors. */
-    [EIO] = N_("Input/output error"),
+    [ERR_REMAP (EIO)] = N_("Input/output error"),
 #endif
 #ifdef ENXIO
 /*
@@ -53,7 +58,7 @@ TRANS represented by a file you specified, and it couldn't find the device.
 TRANS This can mean that the device file was installed incorrectly, or that
 TRANS the physical device is missing or not correctly attached to the
 TRANS computer. */
-    [ENXIO] = N_("Device not configured"),
+    [ERR_REMAP (ENXIO)] = N_("Device not configured"),
 #endif
 #ifdef E2BIG
 /*
@@ -61,27 +66,27 @@ TRANS Argument list too long; used when the arguments passed to a new program
 TRANS being executed with one of the @code{exec} functions (@pxref{Executing a
 TRANS File}) occupy too much memory space.  This condition never arises in the
 TRANS GNU system. */
-    [E2BIG] = N_("Argument list too long"),
+    [ERR_REMAP (E2BIG)] = N_("Argument list too long"),
 #endif
 #ifdef ENOEXEC
 /*
 TRANS Invalid executable file format.  This condition is detected by the
 TRANS @code{exec} functions; see @ref{Executing a File}. */
-    [ENOEXEC] = N_("Exec format error"),
+    [ERR_REMAP (ENOEXEC)] = N_("Exec format error"),
 #endif
 #ifdef EBADF
 /*
 TRANS Bad file descriptor; for example, I/O on a descriptor that has been
 TRANS closed or reading from a descriptor open only for writing (or vice
 TRANS versa). */
-    [EBADF] = N_("Bad file descriptor"),
+    [ERR_REMAP (EBADF)] = N_("Bad file descriptor"),
 #endif
 #ifdef ECHILD
 /*
 TRANS There are no child processes.  This error happens on operations that are
 TRANS supposed to manipulate child processes, when there aren't any processes
 TRANS to manipulate. */
-    [ECHILD] = N_("No child processes"),
+    [ERR_REMAP (ECHILD)] = N_("No child processes"),
 #endif
 #ifdef EDEADLK
 /*
@@ -89,74 +94,74 @@ TRANS Deadlock avoided; allocating a system resource would have resulted in a
 TRANS deadlock situation.  The system does not guarantee that it will notice
 TRANS all such situations.  This error means you got lucky and the system
 TRANS noticed; it might just hang.  @xref{File Locks}, for an example. */
-    [EDEADLK] = N_("Resource deadlock avoided"),
+    [ERR_REMAP (EDEADLK)] = N_("Resource deadlock avoided"),
 #endif
 #ifdef ENOMEM
 /*
 TRANS No memory available.  The system cannot allocate more virtual memory
 TRANS because its capacity is full. */
-    [ENOMEM] = N_("Cannot allocate memory"),
+    [ERR_REMAP (ENOMEM)] = N_("Cannot allocate memory"),
 #endif
 #ifdef EACCES
 /*
 TRANS Permission denied; the file permissions do not allow the attempted operation. */
-    [EACCES] = N_("Permission denied"),
+    [ERR_REMAP (EACCES)] = N_("Permission denied"),
 #endif
 #ifdef EFAULT
 /*
 TRANS Bad address; an invalid pointer was detected.
 TRANS In the GNU system, this error never happens; you get a signal instead. */
-    [EFAULT] = N_("Bad address"),
+    [ERR_REMAP (EFAULT)] = N_("Bad address"),
 #endif
 #ifdef ENOTBLK
 /*
 TRANS A file that isn't a block special file was given in a situation that
 TRANS requires one.  For example, trying to mount an ordinary file as a file
 TRANS system in Unix gives this error. */
-    [ENOTBLK] = N_("Block device required"),
+    [ERR_REMAP (ENOTBLK)] = N_("Block device required"),
 #endif
 #ifdef EBUSY
 /*
 TRANS Resource busy; a system resource that can't be shared is already in use.
 TRANS For example, if you try to delete a file that is the root of a currently
 TRANS mounted filesystem, you get this error. */
-    [EBUSY] = N_("Device or resource busy"),
+    [ERR_REMAP (EBUSY)] = N_("Device or resource busy"),
 #endif
 #ifdef EEXIST
 /*
 TRANS File exists; an existing file was specified in a context where it only
 TRANS makes sense to specify a new file. */
-    [EEXIST] = N_("File exists"),
+    [ERR_REMAP (EEXIST)] = N_("File exists"),
 #endif
 #ifdef EXDEV
 /*
 TRANS An attempt to make an improper link across file systems was detected.
 TRANS This happens not only when you use @code{link} (@pxref{Hard Links}) but
 TRANS also when you rename a file with @code{rename} (@pxref{Renaming Files}). */
-    [EXDEV] = N_("Invalid cross-device link"),
+    [ERR_REMAP (EXDEV)] = N_("Invalid cross-device link"),
 #endif
 #ifdef ENODEV
 /*
 TRANS The wrong type of device was given to a function that expects a
 TRANS particular sort of device. */
-    [ENODEV] = N_("Operation not supported by device"),
+    [ERR_REMAP (ENODEV)] = N_("Operation not supported by device"),
 #endif
 #ifdef ENOTDIR
 /*
 TRANS A file that isn't a directory was specified when a directory is required. */
-    [ENOTDIR] = N_("Not a directory"),
+    [ERR_REMAP (ENOTDIR)] = N_("Not a directory"),
 #endif
 #ifdef EISDIR
 /*
 TRANS File is a directory; you cannot open a directory for writing,
 TRANS or create or remove hard links to it. */
-    [EISDIR] = N_("Is a directory"),
+    [ERR_REMAP (EISDIR)] = N_("Is a directory"),
 #endif
 #ifdef EINVAL
 /*
 TRANS Invalid argument.  This is used to indicate various kinds of problems
 TRANS with passing the wrong argument to a library function. */
-    [EINVAL] = N_("Invalid argument"),
+    [ERR_REMAP (EINVAL)] = N_("Invalid argument"),
 #endif
 #ifdef EMFILE
 /*
@@ -167,20 +172,20 @@ TRANS In BSD and GNU, the number of open files is controlled by a resource
 TRANS limit that can usually be increased.  If you get this error, you might
 TRANS want to increase the @code{RLIMIT_NOFILE} limit or make it unlimited;
 TRANS @pxref{Limits on Resources}. */
-    [EMFILE] = N_("Too many open files"),
+    [ERR_REMAP (EMFILE)] = N_("Too many open files"),
 #endif
 #ifdef ENFILE
 /*
 TRANS There are too many distinct file openings in the entire system.  Note
 TRANS that any number of linked channels count as just one file opening; see
 TRANS @ref{Linked Channels}.  This error never occurs in the GNU system. */
-    [ENFILE] = N_("Too many open files in system"),
+    [ERR_REMAP (ENFILE)] = N_("Too many open files in system"),
 #endif
 #ifdef ENOTTY
 /*
 TRANS Inappropriate I/O control operation, such as trying to set terminal
 TRANS modes on an ordinary file. */
-    [ENOTTY] = N_("Inappropriate ioctl for device"),
+    [ERR_REMAP (ENOTTY)] = N_("Inappropriate ioctl for device"),
 #endif
 #ifdef ETXTBSY
 /*
@@ -189,35 +194,35 @@ TRANS write to a file that is currently being executed.  Often using a
 TRANS debugger to run a program is considered having it open for writing and
 TRANS will cause this error.  (The name stands for ``text file busy''.)  This
 TRANS is not an error in the GNU system; the text is copied as necessary. */
-    [ETXTBSY] = N_("Text file busy"),
+    [ERR_REMAP (ETXTBSY)] = N_("Text file busy"),
 #endif
 #ifdef EFBIG
 /*
 TRANS File too big; the size of a file would be larger than allowed by the system. */
-    [EFBIG] = N_("File too large"),
+    [ERR_REMAP (EFBIG)] = N_("File too large"),
 #endif
 #ifdef ENOSPC
 /*
 TRANS No space left on device; write operation on a file failed because the
 TRANS disk is full. */
-    [ENOSPC] = N_("No space left on device"),
+    [ERR_REMAP (ENOSPC)] = N_("No space left on device"),
 #endif
 #ifdef ESPIPE
 /*
 TRANS Invalid seek operation (such as on a pipe). */
-    [ESPIPE] = N_("Illegal seek"),
+    [ERR_REMAP (ESPIPE)] = N_("Illegal seek"),
 #endif
 #ifdef EROFS
 /*
 TRANS An attempt was made to modify something on a read-only file system. */
-    [EROFS] = N_("Read-only file system"),
+    [ERR_REMAP (EROFS)] = N_("Read-only file system"),
 #endif
 #ifdef EMLINK
 /*
 TRANS Too many links; the link count of a single file would become too large.
 TRANS @code{rename} can cause this error if the file being renamed already has
 TRANS as many links as it can take (@pxref{Renaming Files}). */
-    [EMLINK] = N_("Too many links"),
+    [ERR_REMAP (EMLINK)] = N_("Too many links"),
 #endif
 #ifdef EPIPE
 /*
@@ -226,19 +231,19 @@ TRANS Every library function that returns this error code also generates a
 TRANS @code{SIGPIPE} signal; this signal terminates the program if not handled
 TRANS or blocked.  Thus, your program will never actually see @code{EPIPE}
 TRANS unless it has handled or blocked @code{SIGPIPE}. */
-    [EPIPE] = N_("Broken pipe"),
+    [ERR_REMAP (EPIPE)] = N_("Broken pipe"),
 #endif
 #ifdef EDOM
 /*
 TRANS Domain error; used by mathematical functions when an argument value does
 TRANS not fall into the domain over which the function is defined. */
-    [EDOM] = N_("Numerical argument out of domain"),
+    [ERR_REMAP (EDOM)] = N_("Numerical argument out of domain"),
 #endif
 #ifdef ERANGE
 /*
 TRANS Range error; used by mathematical functions when the result value is
 TRANS not representable because of overflow or underflow. */
-    [ERANGE] = N_("Numerical result out of range"),
+    [ERR_REMAP (ERANGE)] = N_("Numerical result out of range"),
 #endif
 #ifdef EAGAIN
 /*
@@ -271,7 +276,7 @@ TRANS Such shortages are usually fairly serious and affect the whole system,
 TRANS so usually an interactive program should report the error to the user
 TRANS and return to its command loop.
 TRANS @end itemize */
-    [EAGAIN] = N_("Resource temporarily unavailable"),
+    [ERR_REMAP (EAGAIN)] = N_("Resource temporarily unavailable"),
 #endif
 #if defined (EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
 /*
@@ -280,7 +285,7 @@ TRANS The values are always the same, on every operating system.
 TRANS 
 TRANS C libraries in many older Unix systems have @code{EWOULDBLOCK} as a
 TRANS separate error code. */
-    [EWOULDBLOCK] = N_("Operation would block"),
+    [ERR_REMAP (EWOULDBLOCK)] = N_("Operation would block"),
 #endif
 #ifdef EINPROGRESS
 /*
@@ -292,47 +297,47 @@ TRANS the operation has begun and will take some time.  Attempts to manipulate
 TRANS the object before the call completes return @code{EALREADY}.  You can
 TRANS use the @code{select} function to find out when the pending operation
 TRANS has completed; @pxref{Waiting for I/O}. */
-    [EINPROGRESS] = N_("Operation now in progress"),
+    [ERR_REMAP (EINPROGRESS)] = N_("Operation now in progress"),
 #endif
 #ifdef EALREADY
 /*
 TRANS An operation is already in progress on an object that has non-blocking
 TRANS mode selected. */
-    [EALREADY] = N_("Operation already in progress"),
+    [ERR_REMAP (EALREADY)] = N_("Operation already in progress"),
 #endif
 #ifdef ENOTSOCK
 /*
 TRANS A file that isn't a socket was specified when a socket is required. */
-    [ENOTSOCK] = N_("Socket operation on non-socket"),
+    [ERR_REMAP (ENOTSOCK)] = N_("Socket operation on non-socket"),
 #endif
 #ifdef EMSGSIZE
 /*
 TRANS The size of a message sent on a socket was larger than the supported
 TRANS maximum size. */
-    [EMSGSIZE] = N_("Message too long"),
+    [ERR_REMAP (EMSGSIZE)] = N_("Message too long"),
 #endif
 #ifdef EPROTOTYPE
 /*
 TRANS The socket type does not support the requested communications protocol. */
-    [EPROTOTYPE] = N_("Protocol wrong type for socket"),
+    [ERR_REMAP (EPROTOTYPE)] = N_("Protocol wrong type for socket"),
 #endif
 #ifdef ENOPROTOOPT
 /*
 TRANS You specified a socket option that doesn't make sense for the
 TRANS particular protocol being used by the socket.  @xref{Socket Options}. */
-    [ENOPROTOOPT] = N_("Protocol not available"),
+    [ERR_REMAP (ENOPROTOOPT)] = N_("Protocol not available"),
 #endif
 #ifdef EPROTONOSUPPORT
 /*
 TRANS The socket domain does not support the requested communications protocol
 TRANS (perhaps because the requested protocol is completely invalid.)
 TRANS @xref{Creating a Socket}. */
-    [EPROTONOSUPPORT] = N_("Protocol not supported"),
+    [ERR_REMAP (EPROTONOSUPPORT)] = N_("Protocol not supported"),
 #endif
 #ifdef ESOCKTNOSUPPORT
 /*
 TRANS The socket type is not supported. */
-    [ESOCKTNOSUPPORT] = N_("Socket type not supported"),
+    [ERR_REMAP (ESOCKTNOSUPPORT)] = N_("Socket type not supported"),
 #endif
 #ifdef EOPNOTSUPP
 /*
@@ -342,71 +347,71 @@ TRANS implemented for all communications protocols.  In the GNU system, this
 TRANS error can happen for many calls when the object does not support the
 TRANS particular operation; it is a generic indication that the server knows
 TRANS nothing to do for that call. */
-    [EOPNOTSUPP] = N_("Operation not supported"),
+    [ERR_REMAP (EOPNOTSUPP)] = N_("Operation not supported"),
 #endif
 #ifdef EPFNOSUPPORT
 /*
 TRANS The socket communications protocol family you requested is not supported. */
-    [EPFNOSUPPORT] = N_("Protocol family not supported"),
+    [ERR_REMAP (EPFNOSUPPORT)] = N_("Protocol family not supported"),
 #endif
 #ifdef EAFNOSUPPORT
 /*
 TRANS The address family specified for a socket is not supported; it is
 TRANS inconsistent with the protocol being used on the socket.  @xref{Sockets}. */
-    [EAFNOSUPPORT] = N_("Address family not supported by protocol"),
+    [ERR_REMAP (EAFNOSUPPORT)] = N_("Address family not supported by protocol"),
 #endif
 #ifdef EADDRINUSE
 /*
 TRANS The requested socket address is already in use.  @xref{Socket Addresses}. */
-    [EADDRINUSE] = N_("Address already in use"),
+    [ERR_REMAP (EADDRINUSE)] = N_("Address already in use"),
 #endif
 #ifdef EADDRNOTAVAIL
 /*
 TRANS The requested socket address is not available; for example, you tried
 TRANS to give a socket a name that doesn't match the local host name.
 TRANS @xref{Socket Addresses}. */
-    [EADDRNOTAVAIL] = N_("Cannot assign requested address"),
+    [ERR_REMAP (EADDRNOTAVAIL)] = N_("Cannot assign requested address"),
 #endif
 #ifdef ENETDOWN
 /*
 TRANS A socket operation failed because the network was down. */
-    [ENETDOWN] = N_("Network is down"),
+    [ERR_REMAP (ENETDOWN)] = N_("Network is down"),
 #endif
 #ifdef ENETUNREACH
 /*
 TRANS A socket operation failed because the subnet containing the remote host
 TRANS was unreachable. */
-    [ENETUNREACH] = N_("Network is unreachable"),
+    [ERR_REMAP (ENETUNREACH)] = N_("Network is unreachable"),
 #endif
 #ifdef ENETRESET
 /*
 TRANS A network connection was reset because the remote host crashed. */
-    [ENETRESET] = N_("Network dropped connection on reset"),
+    [ERR_REMAP (ENETRESET)] = N_("Network dropped connection on reset"),
 #endif
 #ifdef ECONNABORTED
 /*
 TRANS A network connection was aborted locally. */
-    [ECONNABORTED] = N_("Software caused connection abort"),
+    [ERR_REMAP (ECONNABORTED)] = N_("Software caused connection abort"),
 #endif
 #ifdef ECONNRESET
 /*
 TRANS A network connection was closed for reasons outside the control of the
 TRANS local host, such as by the remote machine rebooting or an unrecoverable
 TRANS protocol violation. */
-    [ECONNRESET] = N_("Connection reset by peer"),
+    [ERR_REMAP (ECONNRESET)] = N_("Connection reset by peer"),
 #endif
 #ifdef ENOBUFS
 /*
 TRANS The kernel's buffers for I/O operations are all in use.  In GNU, this
 TRANS error is always synonymous with @code{ENOMEM}; you may get one or the
 TRANS other from network operations. */
-    [ENOBUFS] = N_("No buffer space available"),
+    [ERR_REMAP (ENOBUFS)] = N_("No buffer space available"),
 #endif
 #ifdef EISCONN
 /*
 TRANS You tried to connect a socket that is already connected.
 TRANS @xref{Connecting}. */
-    [EISCONN] = N_("Transport endpoint is already connected"),
+    [ERR_REMAP (EISCONN)] = N_("Transport endpoint is already connected"),
 #endif
 #ifdef ENOTCONN
 /*
@@ -414,83 +419,83 @@ TRANS The socket is not connected to anything.  You get this error when you
 TRANS try to transmit data over a socket, without first specifying a
 TRANS destination for the data.  For a connectionless socket (for datagram
 TRANS protocols, such as UDP), you get @code{EDESTADDRREQ} instead. */
-    [ENOTCONN] = N_("Transport endpoint is not connected"),
+    [ERR_REMAP (ENOTCONN)] = N_("Transport endpoint is not connected"),
 #endif
 #ifdef EDESTADDRREQ
 /*
 TRANS No default destination address was set for the socket.  You get this
 TRANS error when you try to transmit data over a connectionless socket,
 TRANS without first specifying a destination for the data with @code{connect}. */
-    [EDESTADDRREQ] = N_("Destination address required"),
+    [ERR_REMAP (EDESTADDRREQ)] = N_("Destination address required"),
 #endif
 #ifdef ESHUTDOWN
 /*
 TRANS The socket has already been shut down. */
-    [ESHUTDOWN] = N_("Cannot send after transport endpoint shutdown"),
+    [ERR_REMAP (ESHUTDOWN)] = N_("Cannot send after transport endpoint shutdown"),
 #endif
 #ifdef ETOOMANYREFS
 /*
 TRANS ??? */
-    [ETOOMANYREFS] = N_("Too many references: cannot splice"),
+    [ERR_REMAP (ETOOMANYREFS)] = N_("Too many references: cannot splice"),
 #endif
 #ifdef ETIMEDOUT
 /*
 TRANS A socket operation with a specified timeout received no response during
 TRANS the timeout period. */
-    [ETIMEDOUT] = N_("Connection timed out"),
+    [ERR_REMAP (ETIMEDOUT)] = N_("Connection timed out"),
 #endif
 #ifdef ECONNREFUSED
 /*
 TRANS A remote host refused to allow the network connection (typically because
 TRANS it is not running the requested service). */
-    [ECONNREFUSED] = N_("Connection refused"),
+    [ERR_REMAP (ECONNREFUSED)] = N_("Connection refused"),
 #endif
 #ifdef ELOOP
 /*
 TRANS Too many levels of symbolic links were encountered in looking up a file name.
 TRANS This often indicates a cycle of symbolic links. */
-    [ELOOP] = N_("Too many levels of symbolic links"),
+    [ERR_REMAP (ELOOP)] = N_("Too many levels of symbolic links"),
 #endif
 #ifdef ENAMETOOLONG
 /*
 TRANS Filename too long (longer than @code{PATH_MAX}; @pxref{Limits for
 TRANS Files}) or host name too long (in @code{gethostname} or
 TRANS @code{sethostname}; @pxref{Host Identification}). */
-    [ENAMETOOLONG] = N_("File name too long"),
+    [ERR_REMAP (ENAMETOOLONG)] = N_("File name too long"),
 #endif
 #ifdef EHOSTDOWN
 /*
 TRANS The remote host for a requested network connection is down. */
-    [EHOSTDOWN] = N_("Host is down"),
+    [ERR_REMAP (EHOSTDOWN)] = N_("Host is down"),
 #endif
 #ifdef EHOSTUNREACH
 /*
 TRANS The remote host for a requested network connection is not reachable. */
-    [EHOSTUNREACH] = N_("No route to host"),
+    [ERR_REMAP (EHOSTUNREACH)] = N_("No route to host"),
 #endif
 #ifdef ENOTEMPTY
 /*
 TRANS Directory not empty, where an empty directory was expected.  Typically,
 TRANS this error occurs when you are trying to delete a directory. */
-    [ENOTEMPTY] = N_("Directory not empty"),
+    [ERR_REMAP (ENOTEMPTY)] = N_("Directory not empty"),
 #endif
 #ifdef EPROCLIM
 /*
 TRANS This means that the per-user limit on new process would be exceeded by
 TRANS an attempted @code{fork}.  @xref{Limits on Resources}, for details on
 TRANS the @code{RLIMIT_NPROC} limit. */
-    [EPROCLIM] = N_("Too many processes"),
+    [ERR_REMAP (EPROCLIM)] = N_("Too many processes"),
 #endif
 #ifdef EUSERS
 /*
 TRANS The file quota system is confused because there are too many users.
 TRANS @c This can probably happen in a GNU system when using NFS. */
-    [EUSERS] = N_("Too many users"),
+    [ERR_REMAP (EUSERS)] = N_("Too many users"),
 #endif
 #ifdef EDQUOT
 /*
 TRANS The user's disk quota was exceeded. */
-    [EDQUOT] = N_("Disc quota exceeded"),
+    [ERR_REMAP (EDQUOT)] = N_("Disc quota exceeded"),
 #endif
 #ifdef ESTALE
 /*
@@ -498,7 +503,7 @@ TRANS Stale NFS file handle.  This indicates an internal confusion in the NFS
 TRANS system which is due to file system rearrangements on the server host.
 TRANS Repairing this condition usually requires unmounting and remounting
 TRANS the NFS file system on the local host. */
-    [ESTALE] = N_("Stale NFS file handle"),
+    [ERR_REMAP (ESTALE)] = N_("Stale NFS file handle"),
 #endif
 #ifdef EREMOTE
 /*
@@ -506,32 +511,32 @@ TRANS An attempt was made to NFS-mount a remote file system with a file name tha
 TRANS already specifies an NFS-mounted file.
 TRANS (This is an error on some operating systems, but we expect it to work
 TRANS properly on the GNU system, making this error code impossible.) */
-    [EREMOTE] = N_("Object is remote"),
+    [ERR_REMAP (EREMOTE)] = N_("Object is remote"),
 #endif
 #ifdef EBADRPC
 /*
 TRANS ??? */
-    [EBADRPC] = N_("RPC struct is bad"),
+    [ERR_REMAP (EBADRPC)] = N_("RPC struct is bad"),
 #endif
 #ifdef ERPCMISMATCH
 /*
 TRANS ??? */
-    [ERPCMISMATCH] = N_("RPC version wrong"),
+    [ERR_REMAP (ERPCMISMATCH)] = N_("RPC version wrong"),
 #endif
 #ifdef EPROGUNAVAIL
 /*
 TRANS ??? */
-    [EPROGUNAVAIL] = N_("RPC program not available"),
+    [ERR_REMAP (EPROGUNAVAIL)] = N_("RPC program not available"),
 #endif
 #ifdef EPROGMISMATCH
 /*
 TRANS ??? */
-    [EPROGMISMATCH] = N_("RPC program version wrong"),
+    [ERR_REMAP (EPROGMISMATCH)] = N_("RPC program version wrong"),
 #endif
 #ifdef EPROCUNAVAIL
 /*
 TRANS ??? */
-    [EPROCUNAVAIL] = N_("RPC bad procedure for program"),
+    [ERR_REMAP (EPROCUNAVAIL)] = N_("RPC bad procedure for program"),
 #endif
 #ifdef ENOLCK
 /*
@@ -539,7 +544,7 @@ TRANS No locks available.  This is used by the file locking facilities; see
 TRANS @ref{File Locks}.  This error is never generated by the GNU system, but
 TRANS it can result from an operation to an NFS server running another
 TRANS operating system. */
-    [ENOLCK] = N_("No locks available"),
+    [ERR_REMAP (ENOLCK)] = N_("No locks available"),
 #endif
 #ifdef EFTYPE
 /*
@@ -548,30 +553,30 @@ TRANS operation, or a data file had the wrong format.
 TRANS 
 TRANS On some systems @code{chmod} returns this error if you try to set the
 TRANS sticky bit on a non-directory file; @pxref{Setting Permissions}. */
-    [EFTYPE] = N_("Inappropriate file type or format"),
+    [ERR_REMAP (EFTYPE)] = N_("Inappropriate file type or format"),
 #endif
 #ifdef EAUTH
 /*
 TRANS ??? */
-    [EAUTH] = N_("Authentication error"),
+    [ERR_REMAP (EAUTH)] = N_("Authentication error"),
 #endif
 #ifdef ENEEDAUTH
 /*
 TRANS ??? */
-    [ENEEDAUTH] = N_("Need authenticator"),
+    [ERR_REMAP (ENEEDAUTH)] = N_("Need authenticator"),
 #endif
 #ifdef ENOSYS
 /*
 TRANS Function not implemented.  Some functions have commands or options defined
 TRANS that might not be supported in all implementations, and this is the kind
 TRANS of error you get if you request them and they are not supported. */
-    [ENOSYS] = N_("Function not implemented"),
+    [ERR_REMAP (ENOSYS)] = N_("Function not implemented"),
 #endif
 #ifdef EILSEQ
 /*
 TRANS While decoding a multibyte character the function came along an invalid
 TRANS or an incomplete sequence of bytes or the given wide character is invalid. */
-    [EILSEQ] = N_("Invalid or incomplete multibyte or wide character"),
+    [ERR_REMAP (EILSEQ)] = N_("Invalid or incomplete multibyte or wide character"),
 #endif
 #ifdef EBACKGROUND
 /*
@@ -581,241 +586,243 @@ TRANS foreground process group of the terminal.  Users do not usually see this
 TRANS error because functions such as @code{read} and @code{write} translate
 TRANS it into a @code{SIGTTIN} or @code{SIGTTOU} signal.  @xref{Job Control},
 TRANS for information on process groups and these signals. */
-    [EBACKGROUND] = N_("Inappropriate operation for background process"),
+    [ERR_REMAP (EBACKGROUND)] = N_("Inappropriate operation for background process"),
 #endif
 #ifdef EDIED
 /*
 TRANS In the GNU system, opening a file returns this error when the file is
 TRANS translated by a program and the translator program dies while starting
 TRANS up, before it has connected to the file. */
-    [EDIED] = N_("Translator died"),
+    [ERR_REMAP (EDIED)] = N_("Translator died"),
 #endif
 #ifdef ED
 /*
 TRANS The experienced user will know what is wrong.
 TRANS @c This error code is a joke.  Its perror text is part of the joke.
 TRANS @c Don't change it. */
-    [ED] = N_("?"),
+    [ERR_REMAP (ED)] = N_("?"),
 #endif
 #ifdef EGREGIOUS
 /*
 TRANS You did @strong{what}? */
-    [EGREGIOUS] = N_("You really blew it this time"),
+    [ERR_REMAP (EGREGIOUS)] = N_("You really blew it this time"),
 #endif
 #ifdef EIEIO
 /*
 TRANS Go home and have a glass of warm, dairy-fresh milk. */
-    [EIEIO] = N_("Computer bought the farm"),
+    [ERR_REMAP (EIEIO)] = N_("Computer bought the farm"),
 #endif
 #ifdef EGRATUITOUS
 /*
 TRANS This error code has no purpose. */
-    [EGRATUITOUS] = N_("Gratuitous error"),
+    [ERR_REMAP (EGRATUITOUS)] = N_("Gratuitous error"),
 #endif
 #ifdef EBADMSG
 /* */
-    [EBADMSG] = N_("Bad message"),
+    [ERR_REMAP (EBADMSG)] = N_("Bad message"),
 #endif
 #ifdef EIDRM
 /* */
-    [EIDRM] = N_("Identifier removed"),
+    [ERR_REMAP (EIDRM)] = N_("Identifier removed"),
 #endif
 #ifdef EMULTIHOP
 /* */
-    [EMULTIHOP] = N_("Multihop attempted"),
+    [ERR_REMAP (EMULTIHOP)] = N_("Multihop attempted"),
 #endif
 #ifdef ENODATA
 /* */
-    [ENODATA] = N_("No data available"),
+    [ERR_REMAP (ENODATA)] = N_("No data available"),
 #endif
 #ifdef ENOLINK
 /* */
-    [ENOLINK] = N_("Link has been severed"),
+    [ERR_REMAP (ENOLINK)] = N_("Link has been severed"),
 #endif
 #ifdef ENOMSG
 /* */
-    [ENOMSG] = N_("No message of desired type"),
+    [ERR_REMAP (ENOMSG)] = N_("No message of desired type"),
 #endif
 #ifdef ENOSR
 /* */
-    [ENOSR] = N_("Out of streams resources"),
+    [ERR_REMAP (ENOSR)] = N_("Out of streams resources"),
 #endif
 #ifdef ENOSTR
 /* */
-    [ENOSTR] = N_("Device not a stream"),
+    [ERR_REMAP (ENOSTR)] = N_("Device not a stream"),
 #endif
 #ifdef EOVERFLOW
 /* */
-    [EOVERFLOW] = N_("Value too large for defined data type"),
+    [ERR_REMAP (EOVERFLOW)] = N_("Value too large for defined data type"),
 #endif
 #ifdef EPROTO
 /* */
-    [EPROTO] = N_("Protocol error"),
+    [ERR_REMAP (EPROTO)] = N_("Protocol error"),
 #endif
 #ifdef ETIME
 /* */
-    [ETIME] = N_("Timer expired"),
+    [ERR_REMAP (ETIME)] = N_("Timer expired"),
 #endif
 #ifdef ERESTART
 /* */
-    [ERESTART] = N_("Interrupted system call should be restarted"),
+    [ERR_REMAP (ERESTART)] = N_("Interrupted system call should be restarted"),
 #endif
 #ifdef ECHRNG
 /* */
-    [ECHRNG] = N_("Channel number out of range"),
+    [ERR_REMAP (ECHRNG)] = N_("Channel number out of range"),
 #endif
 #ifdef EL2NSYNC
 /* */
-    [EL2NSYNC] = N_("Level 2 not synchronized"),
+    [ERR_REMAP (EL2NSYNC)] = N_("Level 2 not synchronized"),
 #endif
 #ifdef EL3HLT
 /* */
-    [EL3HLT] = N_("Level 3 halted"),
+    [ERR_REMAP (EL3HLT)] = N_("Level 3 halted"),
 #endif
 #ifdef EL3RST
 /* */
-    [EL3RST] = N_("Level 3 reset"),
+    [ERR_REMAP (EL3RST)] = N_("Level 3 reset"),
 #endif
 #ifdef ELNRNG
 /* */
-    [ELNRNG] = N_("Link number out of range"),
+    [ERR_REMAP (ELNRNG)] = N_("Link number out of range"),
 #endif
 #ifdef EUNATCH
 /* */
-    [EUNATCH] = N_("Protocol driver not attached"),
+    [ERR_REMAP (EUNATCH)] = N_("Protocol driver not attached"),
 #endif
 #ifdef ENOCSI
 /* */
-    [ENOCSI] = N_("No CSI structure available"),
+    [ERR_REMAP (ENOCSI)] = N_("No CSI structure available"),
 #endif
 #ifdef EL2HLT
 /* */
-    [EL2HLT] = N_("Level 2 halted"),
+    [ERR_REMAP (EL2HLT)] = N_("Level 2 halted"),
 #endif
 #ifdef EBADE
 /* */
-    [EBADE] = N_("Invalid exchange"),
+    [ERR_REMAP (EBADE)] = N_("Invalid exchange"),
 #endif
 #ifdef EBADR
 /* */
-    [EBADR] = N_("Invalid request descriptor"),
+    [ERR_REMAP (EBADR)] = N_("Invalid request descriptor"),
 #endif
 #ifdef EXFULL
 /* */
-    [EXFULL] = N_("Exchange full"),
+    [ERR_REMAP (EXFULL)] = N_("Exchange full"),
 #endif
 #ifdef ENOANO
 /* */
-    [ENOANO] = N_("No anode"),
+    [ERR_REMAP (ENOANO)] = N_("No anode"),
 #endif
 #ifdef EBADRQC
 /* */
-    [EBADRQC] = N_("Invalid request code"),
+    [ERR_REMAP (EBADRQC)] = N_("Invalid request code"),
 #endif
 #ifdef EBADSLT
 /* */
-    [EBADSLT] = N_("Invalid slot"),
+    [ERR_REMAP (EBADSLT)] = N_("Invalid slot"),
 #endif
 #if defined (EDEADLOCK) && EDEADLOCK != EDEADLK
 /* */
-    [EDEADLOCK] = N_("File locking deadlock error"),
+    [ERR_REMAP (EDEADLOCK)] = N_("File locking deadlock error"),
 #endif
 #ifdef EBFONT
 /* */
-    [EBFONT] = N_("Bad font file format"),
+    [ERR_REMAP (EBFONT)] = N_("Bad font file format"),
 #endif
 #ifdef ENONET
 /* */
-    [ENONET] = N_("Machine is not on the network"),
+    [ERR_REMAP (ENONET)] = N_("Machine is not on the network"),
 #endif
 #ifdef ENOPKG
 /* */
-    [ENOPKG] = N_("Package not installed"),
+    [ERR_REMAP (ENOPKG)] = N_("Package not installed"),
 #endif
 #ifdef EADV
 /* */
-    [EADV] = N_("Advertise error"),
+    [ERR_REMAP (EADV)] = N_("Advertise error"),
 #endif
 #ifdef ESRMNT
 /* */
-    [ESRMNT] = N_("Srmount error"),
+    [ERR_REMAP (ESRMNT)] = N_("Srmount error"),
 #endif
 #ifdef ECOMM
 /* */
-    [ECOMM] = N_("Communication error on send"),
+    [ERR_REMAP (ECOMM)] = N_("Communication error on send"),
 #endif
 #ifdef EDOTDOT
 /* */
-    [EDOTDOT] = N_("RFS specific error"),
+    [ERR_REMAP (EDOTDOT)] = N_("RFS specific error"),
 #endif
 #ifdef ENOTUNIQ
 /* */
-    [ENOTUNIQ] = N_("Name not unique on network"),
+    [ERR_REMAP (ENOTUNIQ)] = N_("Name not unique on network"),
 #endif
 #ifdef EBADFD
 /* */
-    [EBADFD] = N_("File descriptor in bad state"),
+    [ERR_REMAP (EBADFD)] = N_("File descriptor in bad state"),
 #endif
 #ifdef EREMCHG
 /* */
-    [EREMCHG] = N_("Remote address changed"),
+    [ERR_REMAP (EREMCHG)] = N_("Remote address changed"),
 #endif
 #ifdef ELIBACC
 /* */
-    [ELIBACC] = N_("Can not access a needed shared library"),
+    [ERR_REMAP (ELIBACC)] = N_("Can not access a needed shared library"),
 #endif
 #ifdef ELIBBAD
 /* */
-    [ELIBBAD] = N_("Accessing a corrupted shared library"),
+    [ERR_REMAP (ELIBBAD)] = N_("Accessing a corrupted shared library"),
 #endif
 #ifdef ELIBSCN
 /* */
-    [ELIBSCN] = N_(".lib section in a.out corrupted"),
+    [ERR_REMAP (ELIBSCN)] = N_(".lib section in a.out corrupted"),
 #endif
 #ifdef ELIBMAX
 /* */
-    [ELIBMAX] = N_("Attempting to link in too many shared libraries"),
+    [ERR_REMAP (ELIBMAX)] = N_("Attempting to link in too many shared libraries"),
 #endif
 #ifdef ELIBEXEC
 /* */
-    [ELIBEXEC] = N_("Cannot exec a shared library directly"),
+    [ERR_REMAP (ELIBEXEC)] = N_("Cannot exec a shared library directly"),
 #endif
 #ifdef ESTRPIPE
 /* */
-    [ESTRPIPE] = N_("Streams pipe error"),
+    [ERR_REMAP (ESTRPIPE)] = N_("Streams pipe error"),
 #endif
 #ifdef EUCLEAN
 /* */
-    [EUCLEAN] = N_("Structure needs cleaning"),
+    [ERR_REMAP (EUCLEAN)] = N_("Structure needs cleaning"),
 #endif
 #ifdef ENOTNAM
 /* */
-    [ENOTNAM] = N_("Not a XENIX named type file"),
+    [ERR_REMAP (ENOTNAM)] = N_("Not a XENIX named type file"),
 #endif
 #ifdef ENAVAIL
 /* */
-    [ENAVAIL] = N_("No XENIX semaphores available"),
+    [ERR_REMAP (ENAVAIL)] = N_("No XENIX semaphores available"),
 #endif
 #ifdef EISNAM
 /* */
-    [EISNAM] = N_("Is a named type file"),
+    [ERR_REMAP (EISNAM)] = N_("Is a named type file"),
 #endif
 #ifdef EREMOTEIO
 /* */
-    [EREMOTEIO] = N_("Remote I/O error"),
+    [ERR_REMAP (EREMOTEIO)] = N_("Remote I/O error"),
 #endif
 #ifdef ENOMEDIUM
 /* */
-    [ENOMEDIUM] = N_("No medium found"),
+    [ERR_REMAP (ENOMEDIUM)] = N_("No medium found"),
 #endif
 #ifdef EMEDIUMTYPE
 /* */
-    [EMEDIUMTYPE] = N_("Wrong medium type"),
+    [ERR_REMAP (EMEDIUMTYPE)] = N_("Wrong medium type"),
 #endif
   };
 
 const int SYS_NERR = sizeof SYS_ERRLIST / sizeof SYS_ERRLIST [0];
-#if !defined HAVE_ELF || !defined PIC || !defined DO_VERSIONING
-weak_alias (_sys_errlist, sys_errlist)
-weak_alias (_sys_nerr, sys_nerr)
+#ifdef SYS_ERRLIST_ALIAS
+weak_alias (_sys_errlist, SYS_ERRLIST_ALIAS)
+#endif
+#ifdef SYS_NERR_ALIAS
+weak_alias (_sys_nerr, SYS_NERR_ALIAS)
 #endif