47 [ENAMETOOLONG
] "ENAMETOOLONG",
50 [ENOTEMPTY
] "ENOTEMPTY",
55 [EL2NSYNC
] "EL2NSYNC",
81 [EMULTIHOP
] "EMULTIHOP",
84 [EOVERFLOW
] "EOVERFLOW",
85 [ENOTUNIQ
] "ENOTUNIQ",
92 [ELIBEXEC
] "ELIBEXEC",
94 [ERESTART
] "ERESTART",
95 [ESTRPIPE
] "ESTRPIPE",
97 [ENOTSOCK
] "ENOTSOCK",
98 [EDESTADDRREQ
] "EDESTADDRREQ",
99 [EMSGSIZE
] "EMSGSIZE",
100 [EPROTOTYPE
] "EPROTOTYPE",
101 [ENOPROTOOPT
] "ENOPROTOOPT",
102 [EPROTONOSUPPORT
] "EPROTONOSUPPORT",
103 [ESOCKTNOSUPPORT
] "ESOCKTNOSUPPORT",
104 [EOPNOTSUPP
] "EOPNOTSUPP",
105 [EPFNOSUPPORT
] "EPFNOSUPPORT",
106 [EAFNOSUPPORT
] "EAFNOSUPPORT",
107 [EADDRINUSE
] "EADDRINUSE",
108 [EADDRNOTAVAIL
] "EADDRNOTAVAIL",
109 [ENETDOWN
] "ENETDOWN",
110 [ENETUNREACH
] "ENETUNREACH",
111 [ENETRESET
] "ENETRESET",
112 [ECONNABORTED
] "ECONNABORTED",
113 [ECONNRESET
] "ECONNRESET",
116 [ENOTCONN
] "ENOTCONN",
117 [ESHUTDOWN
] "ESHUTDOWN",
118 [ETOOMANYREFS
] "ETOOMANYREFS",
119 [ETIMEDOUT
] "ETIMEDOUT",
120 [ECONNREFUSED
] "ECONNREFUSED",
121 [EHOSTDOWN
] "EHOSTDOWN",
122 [EHOSTUNREACH
] "EHOSTUNREACH",
123 [EALREADY
] "EALREADY",
124 [EINPROGRESS
] "EINPROGRESS",
130 [EREMOTEIO
] "EREMOTEIO",
132 [ENOMEDIUM
] "ENOMEDIUM",
133 [EMEDIUMTYPE
] "EMEDIUMTYPE",
138 e
= va_arg(f
->args
, int);
139 if(e
>= 0 || -e
>= nelem(t
))
140 return fmtprint(f
, "%d", e
);
141 return fmtprint(f
, "%d [%s]", e
, t
[-e
]);
151 /* from /sys/src/9/port/errstr.h */
152 {EINVAL
, "inconsistent mount"},
153 {EINVAL
, "not mounted"},
154 {EINVAL
, "not in union"},
155 {EIO
, "mount rpc error"},
156 {EIO
, "mounted device shut down"},
157 {EPERM
, "mounted directory forbids creation"},
158 {ENOENT
, "does not exist"},
159 {ENXIO
, "unknown device in # filename"},
160 {ENOTDIR
, "not a directory"},
161 {EISDIR
, "file is a directory"},
162 {EINVAL
, "bad character in file name"},
163 {EINVAL
, "file name syntax"},
164 {EPERM
, "permission denied"},
165 {EPERM
, "inappropriate use of fd"},
166 {EINVAL
, "bad arg in system call"},
167 {EBUSY
, "device or object already in use"},
169 {EIO
, "read or write too large"},
170 {EIO
, "read or write too small"},
171 {EADDRINUSE
, "network port not available"},
172 {ESHUTDOWN
, "write to hungup stream"},
173 {ESHUTDOWN
, "i/o on hungup channel"},
174 {EINVAL
, "bad process or channel control request"},
175 {EBUSY
, "no free devices"},
176 {ESRCH
, "process exited"},
177 {ECHILD
, "no living children"},
178 {EIO
, "i/o error in demand load"},
179 {ENOMEM
, "virtual memory allocation failed"},
180 {EBADF
, "fd out of range or not open"},
181 {EMFILE
, "no free file descriptors"},
182 {ESPIPE
, "seek on a stream"},
183 {ENOEXEC
, "exec header invalid"},
184 {ETIMEDOUT
, "connection timed out"},
185 {ECONNREFUSED
, "connection refused"},
186 {ECONNREFUSED
, "connection in use"},
187 {ERESTART
, "interrupted"},
188 {ENOMEM
, "kernel allocate failed"},
189 {EINVAL
, "segments overlap"},
190 {EIO
, "i/o count too small"},
191 {EINVAL
, "bad attach specifier"},
193 /* from exhausted() calls in kernel */
194 {ENFILE
, "no free file descriptors"},
195 {EBUSY
, "no free mount devices"},
196 {EBUSY
, "no free mount rpc buffer"},
197 {EBUSY
, "no free segments"},
198 {ENOMEM
, "no free memory"},
199 {ENOBUFS
, "no free Blocks"},
200 {EBUSY
, "no free routes"},
203 {EINVAL
, "attach -- bad specifier"},
204 {EBADF
, "unknown fid"},
205 {EINVAL
, "bad character in directory name"},
206 {EBADF
, "read/write -- on non open fid"},
207 {EIO
, "read/write -- count too big"},
208 {EIO
, "phase error -- directory entry not allocated"},
209 {EIO
, "phase error -- qid does not match"},
210 {EACCES
, "access permission denied"},
211 {ENOENT
, "directory entry not found"},
212 {EINVAL
, "open/create -- unknown mode"},
213 {ENOTDIR
, "walk -- in a non-directory"},
214 {ENOTDIR
, "create -- in a non-directory"},
215 {EIO
, "phase error -- cannot happen"},
216 {EEXIST
, "create -- file exists"},
217 {EINVAL
, "create -- . and .. illegal names"},
218 {ENOTEMPTY
, "remove -- directory not empty"},
219 {EINVAL
, "attach -- privileged user"},
220 {EPERM
, "wstat -- not owner"},
221 {EPERM
, "wstat -- not in group"},
222 {EINVAL
, "create/wstat -- bad character in file name"},
223 {EBUSY
, "walk -- too many (system wide)"},
224 {EROFS
, "file system read only"},
225 {ENOSPC
, "file system full"},
226 {EINVAL
, "read/write -- offset negative"},
227 {EBUSY
, "open/create -- file is locked"},
228 {EBUSY
, "close/read/write -- lock is broken"},
231 {ENOTSOCK
, "not a socket"},
232 {EPROTONOSUPPORT
, "protocol not supported"},
233 {ECONNREFUSED
, "connection refused"},
234 {EAFNOSUPPORT
, "address family not supported"},
235 {ENOBUFS
, "insufficient buffer space"},
236 {EOPNOTSUPP
, "operation not supported"},
237 {EADDRINUSE
, "address in use"},
240 {EEXIST
, "file already exists"},
241 {EEXIST
, "is a directory"},
242 {ENOTEMPTY
, "directory not empty"},
248 rerrstr(msg
, sizeof(msg
));
251 for(i
=0; i
<nelem(t
); i
++){
252 if(strstr(msg
, t
[i
].msg
)){
258 trace("mkerror(%s): %E", msg
, r
);
264 trace("syscall %s not implemented", current
->syscall
);