1 /* $NetBSD: compat_errlist.c,v 1.3 2024/01/20 14:52:45 christos Exp $ */ 2 3 /* 4 * Copyright (c) 1982, 1985, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. Neither the name of the University nor the names of its contributors 16 * may be used to endorse or promote products derived from this software 17 * without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 */ 31 32 #include <sys/cdefs.h> 33 #if defined(LIBC_SCCS) && !defined(lint) 34 #if 0 35 static char sccsid[] = "@(#)errlst.c 8.2 (Berkeley) 11/16/93"; 36 #else 37 __RCSID("$NetBSD: compat_errlist.c,v 1.3 2024/01/20 14:52:45 christos Exp $"); 38 #endif 39 #endif /* LIBC_SCCS and not lint */ 40 41 #include "namespace.h" 42 43 #include <compat/include/errno.h> 44 #ifdef __weak_alias 45 __weak_alias(sys_errlist, _sys_errlist) 46 __weak_alias(__sys_errlist, _sys_errlist) 47 __weak_alias(sys_nerr, _sys_nerr) 48 __weak_alias(__sys_nerr, _sys_nerr) 49 #endif 50 51 const char *const sys_errlist[] = { 52 "Undefined error: 0", /* 0 - ENOERROR */ 53 "Operation not permitted", /* 1 - EPERM */ 54 "No such file or directory", /* 2 - ENOENT */ 55 "No such process", /* 3 - ESRCH */ 56 "Interrupted system call", /* 4 - EINTR */ 57 "Input/output error", /* 5 - EIO */ 58 "Device not configured", /* 6 - ENXIO */ 59 "Argument list too long", /* 7 - E2BIG */ 60 "Exec format error", /* 8 - ENOEXEC */ 61 "Bad file descriptor", /* 9 - EBADF */ 62 "No child processes", /* 10 - ECHILD */ 63 "Resource deadlock avoided", /* 11 - EDEADLK */ 64 "Cannot allocate memory", /* 12 - ENOMEM */ 65 "Permission denied", /* 13 - EACCES */ 66 "Bad address", /* 14 - EFAULT */ 67 "Block device required", /* 15 - ENOTBLK */ 68 "Device busy", /* 16 - EBUSY */ 69 "File exists", /* 17 - EEXIST */ 70 "Cross-device link", /* 18 - EXDEV */ 71 "Operation not supported by device", /* 19 - ENODEV */ 72 "Not a directory", /* 20 - ENOTDIR */ 73 "Is a directory", /* 21 - EISDIR */ 74 "Invalid argument", /* 22 - EINVAL */ 75 "Too many open files in system", /* 23 - ENFILE */ 76 "Too many open files", /* 24 - EMFILE */ 77 "Inappropriate ioctl for device", /* 25 - ENOTTY */ 78 "Text file busy", /* 26 - ETXTBSY */ 79 "File too large", /* 27 - EFBIG */ 80 "No space left on device", /* 28 - ENOSPC */ 81 "Illegal seek", /* 29 - ESPIPE */ 82 "Read-only file system", /* 30 - EROFS */ 83 "Too many links", /* 31 - EMLINK */ 84 "Broken pipe", /* 32 - EPIPE */ 85 86 /* math software */ 87 "Numerical argument out of domain", /* 33 - EDOM */ 88 "Result too large or too small", /* 34 - ERANGE */ 89 90 /* non-blocking and interrupt i/o */ 91 "Resource temporarily unavailable", /* 35 - EAGAIN */ 92 /* 35 - EWOULDBLOCK */ 93 "Operation now in progress", /* 36 - EINPROGRESS */ 94 "Operation already in progress", /* 37 - EALREADY */ 95 96 /* ipc/network software -- argument errors */ 97 "Socket operation on non-socket", /* 38 - ENOTSOCK */ 98 "Destination address required", /* 39 - EDESTADDRREQ */ 99 "Message too long", /* 40 - EMSGSIZE */ 100 "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ 101 "Protocol option not available", /* 42 - ENOPROTOOPT */ 102 "Protocol not supported", /* 43 - EPROTONOSUPPORT */ 103 "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ 104 "Operation not supported", /* 45 - EOPNOTSUPP */ 105 "Protocol family not supported", /* 46 - EPFNOSUPPORT */ 106 /* 47 - EAFNOSUPPORT */ 107 "Address family not supported by protocol family", 108 "Address already in use", /* 48 - EADDRINUSE */ 109 "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ 110 111 /* ipc/network software -- operational errors */ 112 "Network is down", /* 50 - ENETDOWN */ 113 "Network is unreachable", /* 51 - ENETUNREACH */ 114 "Network dropped connection on reset", /* 52 - ENETRESET */ 115 "Software caused connection abort", /* 53 - ECONNABORTED */ 116 "Connection reset by peer", /* 54 - ECONNRESET */ 117 "No buffer space available", /* 55 - ENOBUFS */ 118 "Socket is already connected", /* 56 - EISCONN */ 119 "Socket is not connected", /* 57 - ENOTCONN */ 120 "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ 121 "Too many references: can't splice", /* 59 - ETOOMANYREFS */ 122 "Operation timed out", /* 60 - ETIMEDOUT */ 123 "Connection refused", /* 61 - ECONNREFUSED */ 124 125 "Too many levels of symbolic links", /* 62 - ELOOP */ 126 "File name too long", /* 63 - ENAMETOOLONG */ 127 128 /* should be rearranged */ 129 "Host is down", /* 64 - EHOSTDOWN */ 130 "No route to host", /* 65 - EHOSTUNREACH */ 131 "Directory not empty", /* 66 - ENOTEMPTY */ 132 133 /* quotas & mush */ 134 "Too many processes", /* 67 - EPROCLIM */ 135 "Too many users", /* 68 - EUSERS */ 136 "Disc quota exceeded", /* 69 - EDQUOT */ 137 138 /* Network File System */ 139 "Stale NFS file handle", /* 70 - ESTALE */ 140 "Too many levels of remote in path", /* 71 - EREMOTE */ 141 "RPC struct is bad", /* 72 - EBADRPC */ 142 "RPC version wrong", /* 73 - ERPCMISMATCH */ 143 "RPC prog. not avail", /* 74 - EPROGUNAVAIL */ 144 "Program version wrong", /* 75 - EPROGMISMATCH */ 145 "Bad procedure for program", /* 76 - EPROCUNAVAIL */ 146 147 "No locks available", /* 77 - ENOLCK */ 148 "Function not implemented", /* 78 - ENOSYS */ 149 150 "Inappropriate file type or format", /* 79 - EFTYPE */ 151 }; 152 const int sys_nerr = { sizeof(sys_errlist) / sizeof(sys_errlist[0]) }; 153