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