errlst.c revision 92986
11573Srgrimes/* 21573Srgrimes * Copyright (c) 1982, 1985, 1993 31573Srgrimes * The Regents of the University of California. All rights reserved. 41573Srgrimes * 51573Srgrimes * Redistribution and use in source and binary forms, with or without 61573Srgrimes * modification, are permitted provided that the following conditions 71573Srgrimes * are met: 81573Srgrimes * 1. Redistributions of source code must retain the above copyright 91573Srgrimes * notice, this list of conditions and the following disclaimer. 101573Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111573Srgrimes * notice, this list of conditions and the following disclaimer in the 121573Srgrimes * documentation and/or other materials provided with the distribution. 131573Srgrimes * 3. All advertising materials mentioning features or use of this software 141573Srgrimes * must display the following acknowledgement: 151573Srgrimes * This product includes software developed by the University of 161573Srgrimes * California, Berkeley and its contributors. 171573Srgrimes * 4. Neither the name of the University nor the names of its contributors 181573Srgrimes * may be used to endorse or promote products derived from this software 191573Srgrimes * without specific prior written permission. 201573Srgrimes * 211573Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221573Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231573Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241573Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251573Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261573Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271573Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281573Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291573Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301573Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311573Srgrimes * SUCH DAMAGE. 321573Srgrimes */ 331573Srgrimes 341573Srgrimes#if defined(LIBC_SCCS) && !defined(lint) 351573Srgrimesstatic char sccsid[] = "@(#)errlst.c 8.2 (Berkeley) 11/16/93"; 361573Srgrimes#endif /* LIBC_SCCS and not lint */ 3792986Sobrien#include <sys/cdefs.h> 3892986Sobrien__FBSDID("$FreeBSD: head/lib/libc/gen/errlst.c 92986 2002-03-22 21:53:29Z obrien $"); 391573Srgrimes 401573Srgrimes#include <stdio.h> 411573Srgrimes 421573Srgrimesconst char *const sys_errlist[] = { 431573Srgrimes "Undefined error: 0", /* 0 - ENOERROR */ 441573Srgrimes "Operation not permitted", /* 1 - EPERM */ 451573Srgrimes "No such file or directory", /* 2 - ENOENT */ 461573Srgrimes "No such process", /* 3 - ESRCH */ 471573Srgrimes "Interrupted system call", /* 4 - EINTR */ 481573Srgrimes "Input/output error", /* 5 - EIO */ 491573Srgrimes "Device not configured", /* 6 - ENXIO */ 501573Srgrimes "Argument list too long", /* 7 - E2BIG */ 511573Srgrimes "Exec format error", /* 8 - ENOEXEC */ 521573Srgrimes "Bad file descriptor", /* 9 - EBADF */ 531573Srgrimes "No child processes", /* 10 - ECHILD */ 541573Srgrimes "Resource deadlock avoided", /* 11 - EDEADLK */ 551573Srgrimes "Cannot allocate memory", /* 12 - ENOMEM */ 561573Srgrimes "Permission denied", /* 13 - EACCES */ 571573Srgrimes "Bad address", /* 14 - EFAULT */ 581573Srgrimes "Block device required", /* 15 - ENOTBLK */ 591573Srgrimes "Device busy", /* 16 - EBUSY */ 601573Srgrimes "File exists", /* 17 - EEXIST */ 611573Srgrimes "Cross-device link", /* 18 - EXDEV */ 621573Srgrimes "Operation not supported by device", /* 19 - ENODEV */ 631573Srgrimes "Not a directory", /* 20 - ENOTDIR */ 641573Srgrimes "Is a directory", /* 21 - EISDIR */ 651573Srgrimes "Invalid argument", /* 22 - EINVAL */ 661573Srgrimes "Too many open files in system", /* 23 - ENFILE */ 671573Srgrimes "Too many open files", /* 24 - EMFILE */ 681573Srgrimes "Inappropriate ioctl for device", /* 25 - ENOTTY */ 691573Srgrimes "Text file busy", /* 26 - ETXTBSY */ 701573Srgrimes "File too large", /* 27 - EFBIG */ 711573Srgrimes "No space left on device", /* 28 - ENOSPC */ 721573Srgrimes "Illegal seek", /* 29 - ESPIPE */ 731573Srgrimes "Read-only file system", /* 30 - EROFS */ 741573Srgrimes "Too many links", /* 31 - EMLINK */ 751573Srgrimes "Broken pipe", /* 32 - EPIPE */ 761573Srgrimes 771573Srgrimes/* math software */ 781573Srgrimes "Numerical argument out of domain", /* 33 - EDOM */ 791573Srgrimes "Result too large", /* 34 - ERANGE */ 801573Srgrimes 811573Srgrimes/* non-blocking and interrupt i/o */ 821573Srgrimes "Resource temporarily unavailable", /* 35 - EAGAIN */ 831573Srgrimes /* 35 - EWOULDBLOCK */ 841573Srgrimes "Operation now in progress", /* 36 - EINPROGRESS */ 851573Srgrimes "Operation already in progress", /* 37 - EALREADY */ 861573Srgrimes 871573Srgrimes/* ipc/network software -- argument errors */ 881573Srgrimes "Socket operation on non-socket", /* 38 - ENOTSOCK */ 891573Srgrimes "Destination address required", /* 39 - EDESTADDRREQ */ 901573Srgrimes "Message too long", /* 40 - EMSGSIZE */ 911573Srgrimes "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ 921573Srgrimes "Protocol not available", /* 42 - ENOPROTOOPT */ 931573Srgrimes "Protocol not supported", /* 43 - EPROTONOSUPPORT */ 941573Srgrimes "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ 951573Srgrimes "Operation not supported", /* 45 - EOPNOTSUPP */ 961573Srgrimes "Protocol family not supported", /* 46 - EPFNOSUPPORT */ 971573Srgrimes /* 47 - EAFNOSUPPORT */ 981573Srgrimes "Address family not supported by protocol family", 991573Srgrimes "Address already in use", /* 48 - EADDRINUSE */ 1001573Srgrimes "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ 1011573Srgrimes 1021573Srgrimes/* ipc/network software -- operational errors */ 1031573Srgrimes "Network is down", /* 50 - ENETDOWN */ 1041573Srgrimes "Network is unreachable", /* 51 - ENETUNREACH */ 1051573Srgrimes "Network dropped connection on reset", /* 52 - ENETRESET */ 1061573Srgrimes "Software caused connection abort", /* 53 - ECONNABORTED */ 1071573Srgrimes "Connection reset by peer", /* 54 - ECONNRESET */ 1081573Srgrimes "No buffer space available", /* 55 - ENOBUFS */ 1091573Srgrimes "Socket is already connected", /* 56 - EISCONN */ 1101573Srgrimes "Socket is not connected", /* 57 - ENOTCONN */ 1111573Srgrimes "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ 1121573Srgrimes "Too many references: can't splice", /* 59 - ETOOMANYREFS */ 1131573Srgrimes "Operation timed out", /* 60 - ETIMEDOUT */ 1141573Srgrimes "Connection refused", /* 61 - ECONNREFUSED */ 1151573Srgrimes 1161573Srgrimes "Too many levels of symbolic links", /* 62 - ELOOP */ 1171573Srgrimes "File name too long", /* 63 - ENAMETOOLONG */ 1181573Srgrimes 1191573Srgrimes/* should be rearranged */ 1201573Srgrimes "Host is down", /* 64 - EHOSTDOWN */ 1211573Srgrimes "No route to host", /* 65 - EHOSTUNREACH */ 1221573Srgrimes "Directory not empty", /* 66 - ENOTEMPTY */ 1231573Srgrimes 1241573Srgrimes/* quotas & mush */ 1251573Srgrimes "Too many processes", /* 67 - EPROCLIM */ 1261573Srgrimes "Too many users", /* 68 - EUSERS */ 1271573Srgrimes "Disc quota exceeded", /* 69 - EDQUOT */ 1281573Srgrimes 1291573Srgrimes/* Network File System */ 1301573Srgrimes "Stale NFS file handle", /* 70 - ESTALE */ 1311573Srgrimes "Too many levels of remote in path", /* 71 - EREMOTE */ 1321573Srgrimes "RPC struct is bad", /* 72 - EBADRPC */ 1331573Srgrimes "RPC version wrong", /* 73 - ERPCMISMATCH */ 1341573Srgrimes "RPC prog. not avail", /* 74 - EPROGUNAVAIL */ 1351573Srgrimes "Program version wrong", /* 75 - EPROGMISMATCH */ 1361573Srgrimes "Bad procedure for program", /* 76 - EPROCUNAVAIL */ 1371573Srgrimes 1381573Srgrimes "No locks available", /* 77 - ENOLCK */ 1391573Srgrimes "Function not implemented", /* 78 - ENOSYS */ 1401573Srgrimes "Inappropriate file type or format", /* 79 - EFTYPE */ 14146018Sphk "Authentication error", /* 80 - EAUTH */ 14246018Sphk "Need authenticator", /* 81 - ENEEDAUTH */ 14346018Sphk "Identifier removed", /* 82 - EIDRM */ 14446018Sphk "No message of desired type", /* 83 - ENOMSG */ 14546018Sphk "Value too large to be stored in data type", /* 84 - EOVERFLOW */ 14646018Sphk "Operation canceled", /* 85 - ECANCELED */ 14746018Sphk "Illegal byte sequence", /* 86 - EILSEQ */ 14891814Sgreen "Attribute not found", /* 87 - ENOATTR */ 1491573Srgrimes}; 1501573Srgrimesint errno; 1511573Srgrimesconst int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); 152