Subversion Repositories shark

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Copyright (C) 1991, 1992, 1993, 1997, 1998, 1999
2
   Free Software Foundation, Inc.
3
   This file is part of the GNU C Library.
4
 
5
   The GNU C Library is free software; you can redistribute it and/or
6
   modify it under the terms of the GNU Library General Public License as
7
   published by the Free Software Foundation; either version 2 of the
8
   License, or (at your option) any later version.
9
 
10
   The GNU C Library is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
   Library General Public License for more details.
14
 
15
   You should have received a copy of the GNU Library General Public
16
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
17
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
   Boston, MA 02111-1307, USA.  */
19
 
20
#include <errno.h>
21
#include <kernel/const.h>
1689 fabio 22
#include <arch/stdlib.h>
23
#include <arch/stdio.h>
2 pj 24
#include <kernel/func.h>
25
 
26
/* This is a list of all known `errno' codes.  */
27
 
28
#define N_(x) x
29
 
30
const char *const _sys_errlist[] =
31
  {
32
    N_("Success"),
33
 
34
    /* LIBC errors */
35
    N_("Operation not permitted"),
36
    N_("No such file or directory"),
37
    N_("No such process"),
38
    N_("Interrupted system call"),
39
    N_("Input/output error"),
40
    N_("Device not configured"),
41
    N_("Argument list too long"),
42
    N_("Exec format error"),
43
    N_("Bad file descriptor"),
44
    N_("No child processes"),
45
    N_("Resource temporarily unavailable"),
46
    N_("Cannot allocate memory"),
47
    N_("Permission denied"),
48
    N_("Bad address"),
49
    N_("Block device required"),
50
    N_("Device or resource busy"),
51
    N_("File exists"),
52
    N_("Invalid cross-device link"),
53
    N_("No such device"),
54
    N_("Not a directory"),
55
    N_("Is a directory"),
56
    N_("Invalid argument"),
57
    N_("Too many open files in system"),
58
    N_("Too many open files"),
59
    N_("Inappropriate ioctl for device"),
60
    N_("Text file busy"),
61
    N_("File too large"),
62
    N_("No space left on device"),
63
    N_("Illegal seek"),
64
    N_("Read-only file system"),
65
    N_("Too many links"),
66
    N_("Broken pipe"),
67
    N_("Numerical argument out of domain"),
68
    N_("Numerical result out of range"),
69
    N_("Resource deadlock avoided"),
70
    N_("File name too long"),
71
    N_("No locks available"),
72
    N_("Function not implemented"),
73
    N_("Directory not empty"),
74
    N_("Too many levels of symbolic links"),
75
    N_("(null)"),
76
    N_("No message of desired type"),
77
    N_("Identifier removed"),
78
    N_("Channel number out of range"),
79
    N_("Level 2 not synchronized"),
80
    N_("Level 3 halted"),
81
    N_("Level 3 reset"),
82
    N_("Link number out of range"),
83
    N_("Protocol driver not attached"),
84
    N_("No CSI structure available"),
85
    N_("Level 2 halted"),
86
    N_("Invalid exchange"),
87
    N_("Invalid request descriptor"),
88
    N_("Exchange full"),
89
    N_("No anode"),
90
    N_("Invalid request code"),
91
    N_("Invalid slot"),
92
    N_("(null)"),
93
    N_("Bad font file format"),
94
    N_("Device not a stream"),
95
    N_("No data available"),
96
    N_("Timer expired"),
97
    N_("Out of streams resources"),
98
    N_("Machine is not on the network"),
99
    N_("Package not installed"),
100
    N_("Object is remote"),
101
    N_("Link has been severed"),
102
    N_("Advertise error"),
103
    N_("Srmount error"),
104
    N_("Communication error on send"),
105
    N_("Protocol error"),
106
    N_("Multihop attempted"),
107
    N_("RFS specific error"),
108
    N_("Bad message"),
109
    N_("Value too large for defined data type"),
110
    N_("Name not unique on network"),
111
    N_("File descriptor in bad state"),
112
    N_("Remote address changed"),
113
    N_("Can not access a needed shared library"),
114
    N_("Accessing a corrupted shared library"),
115
    N_(".lib section in a.out corrupted"),
116
    N_("Attempting to link in too many shared libraries"),
117
    N_("Cannot exec a shared library directly"),
118
    N_("Invalid or incomplete multibyte or wide character"),
119
    N_("Interrupted system call should be restarted"),
120
    N_("Streams pipe error"),
121
    N_("Too many users"),
122
    N_("Socket operation on non-socket"),
123
    N_("Destination address required"),
124
    N_("Message too long"),
125
    N_("Protocol wrong type for socket"),
126
    N_("Protocol not available"),
127
    N_("Protocol not supported"),
128
    N_("Socket type not supported"),
129
    N_("Operation not supported"),
130
    N_("Protocol family not supported"),
131
    N_("Address family not supported by protocol"),
132
    N_("Address already in use"),
133
    N_("Cannot assign requested address"),
134
    N_("Network is down"),
135
    N_("Network is unreachable"),
136
    N_("Network dropped connection on reset"),
137
    N_("Software caused connection abort"),
138
    N_("Connection reset by peer"),
139
    N_("No buffer space available"),
140
    N_("Transport endpoint is already connected"),
141
    N_("Transport endpoint is not connected"),
142
    N_("Cannot send after transport endpoint shutdown"),
143
    N_("Too many references: cannot splice"),
144
    N_("Connection timed out"),
145
    N_("Connection refused"),
146
    N_("Host is down"),
147
    N_("No route to host"),
148
    N_("Operation already in progress"),
149
    N_("Operation now in progress"),
150
    N_("Stale NFS file handle"),
151
    N_("Structure needs cleaning"),
152
    N_("Not a XENIX named type file"),
153
    N_("No XENIX semaphores available"),
154
    N_("Is a named type file"),
155
    N_("Remote I/O error"),
156
    N_("Disk quota exceeded"),
157
    N_("No medium found"),
158
    N_("Wrong medium type"),
159
    N_("Cancelled"),
160
 
161
    /* S.Ha.R.K.'s errors */
162
    N_("Wrong interrupt number"),
163
    N_("Already used interrupt number"),
164
    N_("Unused interrupt number"),
165
    N_("Too much init functions"),
166
    N_("Too much exit functions"),
167
    N_("No task descriptor available"),
168
    N_("Schedule module not found for the model used"),
169
    N_("Error during task_create"),
170
    N_("Resource module not found for the model used"),
171
    N_("Created task cannot be guaranteed"),
172
    N_("No stack memory available"),
173
    N_("No TSS available to create another task"),
174
    N_("Invalid kill"),
175
    N_("Invalid task ID"),
176
    N_("Invalid group"),
177
 
178
    N_("No more port descriptor"),
179
    N_("No more port interface"),
180
    N_("Incompatible message declaration"),
181
    N_("Port already open"),
182
    N_("No more hash entries"),
183
    N_("2 connection on same receive port"),
184
    N_("Unsupported port access"),
185
    N_("Wrong port operation"),
186
    N_("Wrong port type"),
187
    N_("Invalid Port Descriptor"),
188
 
189
    N_("Cab id not valid"),
190
    N_("Cab is closed"),
191
    N_("Unvalid number of message"),
192
    N_("No more cab free"),
193
    N_("Number of message exceeded"),
194
 
195
    NULL
196
  };
197
 
198
/* Print a line on stderr consisting of the text in S, a colon, a space,
199
   a message describing the meaning of the contents of `errno' and a newline.
200
   If S is NULL or "", the colon and space are omitted.  */
201
void
202
perror (const char *s)
203
{
204
  int errnum = errno;
205
  const char *colon, *st;
206
 
207
  if (s == NULL || *s == '\0')
208
    st = colon = "";
209
  else {
210
    colon = ": ";
211
    st = s;
212
  }
213
 
214
  if (errnum > LAST_ERR_NUMBER)
215
    errnum = LAST_ERR_NUMBER;
216
 
217
  kern_printf ("%s%s%s\n", st, colon, _sys_errlist[errnum]);
218
}
219
 
220
const char *strerror(int errnum)
221
{
222
  if (errnum > LAST_ERR_NUMBER || errnum < 0 )
223
    errnum = LAST_ERR_NUMBER;
224
 
225
  return _sys_errlist[errnum];
226
}
227
 
228