Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * Massimiliano Giorgi <massy@gandalf.sssup.it> |
||
11 | * Luca Abeni <luca@gandalf.sssup.it> |
||
12 | * (see the web pages for full authors list) |
||
13 | * |
||
14 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
15 | * |
||
16 | * http://www.sssup.it |
||
17 | * http://retis.sssup.it |
||
18 | * http://shark.sssup.it |
||
19 | */ |
||
20 | |||
21 | /** |
||
22 | ------------ |
||
23 | CVS : $Id: strerror.c,v 1.1.1.1 2002-03-29 14:12:53 pj Exp $ |
||
24 | |||
25 | File: $File$ |
||
26 | Revision: $Revision: 1.1.1.1 $ |
||
27 | Last update: $Date: 2002-03-29 14:12:53 $ |
||
28 | ------------ |
||
29 | **/ |
||
30 | |||
31 | /* |
||
32 | * Copyright (C) 2000 Paolo Gai |
||
33 | * |
||
34 | * This program is free software; you can redistribute it and/or modify |
||
35 | * it under the terms of the GNU General Public License as published by |
||
36 | * the Free Software Foundation; either version 2 of the License, or |
||
37 | * (at your option) any later version. |
||
38 | * |
||
39 | * This program is distributed in the hope that it will be useful, |
||
40 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
41 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
42 | * GNU General Public License for more details. |
||
43 | * |
||
44 | * You should have received a copy of the GNU General Public License |
||
45 | * along with this program; if not, write to the Free Software |
||
46 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
47 | * |
||
48 | */ |
||
49 | |||
50 | #include "errno.h" |
||
51 | |||
52 | static char *emsg[]={ |
||
53 | "No error", |
||
54 | "Operation not permitted", |
||
55 | "No such file or directory", |
||
56 | "No such process", |
||
57 | "Interrupted system call", |
||
58 | "I/O error", |
||
59 | "No such device or address", |
||
60 | "Arg list too long", |
||
61 | "Exec format error", |
||
62 | "Bad file number", |
||
63 | "No child processes", |
||
64 | "Try again", |
||
65 | "Out of memory", |
||
66 | "Permission denied", |
||
67 | "Bad address", |
||
68 | "Block device required", |
||
69 | "Device or resource busy", |
||
70 | "File exists", |
||
71 | "Cross-device link", |
||
72 | "No such device", |
||
73 | "Not a directory", |
||
74 | "Is a directory", |
||
75 | "Invalid argument", |
||
76 | "File table overflow", |
||
77 | "Too many open files", |
||
78 | "Not a typewriter", |
||
79 | "Text file busy", |
||
80 | "File too large", |
||
81 | "No space left on device", |
||
82 | "Illegal seek", |
||
83 | "Read-only file system", |
||
84 | "Too many links", |
||
85 | "Broken pipe", |
||
86 | "Math argument out of domain of func", |
||
87 | "Math result not representable", |
||
88 | "Resource deadlock would occur", |
||
89 | "File name too long", |
||
90 | "No record locks available", |
||
91 | "Function not implemented", |
||
92 | "Directory not empty", |
||
93 | "Too many symbolic links encountered", |
||
94 | "Operation would block", |
||
95 | "No message of desired type", |
||
96 | "Identifier removed", |
||
97 | "Channel number out of range", |
||
98 | "Level 2 not synchronized", |
||
99 | "Level 3 halted", |
||
100 | "Level 3 reset", |
||
101 | "Link number out of range", |
||
102 | "Protocol driver not attached", |
||
103 | "No CSI structure available", |
||
104 | "Level 2 halted", |
||
105 | "Invalid exchange", |
||
106 | "Invalid request descriptor", |
||
107 | "Exchange full", |
||
108 | "No anode", |
||
109 | "Invalid request code", |
||
110 | "Invalid slot", |
||
111 | "Resource deadlock would occur", |
||
112 | "Bad font file format", |
||
113 | "Device not a stream", |
||
114 | "No data available", |
||
115 | "Timer expired", |
||
116 | "Out of streams resources", |
||
117 | "Machine is not on the network", |
||
118 | "Package not installed", |
||
119 | "Object is remote", |
||
120 | "Link has been severed", |
||
121 | "Advertise error", |
||
122 | "Srmount error", |
||
123 | "Communication error on send", |
||
124 | "Protocol error", |
||
125 | "Multihop attempted", |
||
126 | "RFS specific error", |
||
127 | "Not a data message", |
||
128 | "Value too large for defined data type", |
||
129 | "Name not unique on network", |
||
130 | "File descriptor in bad state", |
||
131 | "Remote address changed", |
||
132 | "Can not access a needed shared library", |
||
133 | "Accessing a corrupted shared library", |
||
134 | ".lib section in a.out corrupted", |
||
135 | "Attempting to link in too many shared libraries", |
||
136 | "Cannot exec a shared library directly", |
||
137 | "Illegal byte sequence", |
||
138 | "Interrupted system call should be restarted", |
||
139 | "Streams pipe error", |
||
140 | "Too many users", |
||
141 | "Socket operation on non-socket", |
||
142 | "Destination address required", |
||
143 | "Message too long", |
||
144 | "Protocol wrong type for socket", |
||
145 | "Protocol not available", |
||
146 | "Protocol not supported", |
||
147 | "Socket type not supported", |
||
148 | "Operation not supported on transport endpoint", |
||
149 | "Protocol family not supported", |
||
150 | "Address family not supported by protocol", |
||
151 | "Address already in use", |
||
152 | "Cannot assign requested address", |
||
153 | "Network is down", |
||
154 | "Network is unreachable", |
||
155 | "Network dropped connection because of reset", |
||
156 | "Software caused connection abort", |
||
157 | "Connection reset by peer", |
||
158 | "No buffer space available", |
||
159 | "Transport endpoint is already connected", |
||
160 | "Transport endpoint is not connected", |
||
161 | "Cannot send after transport endpoint shutdown", |
||
162 | "Too many references: cannot splice", |
||
163 | "Connection timed out", |
||
164 | "Connection refused", |
||
165 | "Host is down", |
||
166 | "No route to host", |
||
167 | "Operation already in progress", |
||
168 | "Operation now in progress", |
||
169 | "Stale NFS file handle", |
||
170 | "Structure needs cleaning", |
||
171 | "Not a XENIX named type file", |
||
172 | "No XENIX semaphores available", |
||
173 | "Is a named type file", |
||
174 | "Remote I/O error", |
||
175 | "Quota exceeded", |
||
176 | "No medium found", |
||
177 | "Wrong medium type" |
||
178 | }; |
||
179 | |||
180 | char *strerror(int error) |
||
181 | { |
||
182 | extern char *sys_err(int); |
||
183 | |||
184 | if (error>=STDERRNOBASE) { |
||
185 | if (error<STDERRNOBASE+STDERRNOMAX) return emsg[error-STDERRNOBASE]; |
||
186 | return "Unknown standard error number"; |
||
187 | } |
||
188 | |||
189 | return sys_err(error); |
||
190 | } |