mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
oops
This commit is contained in:
parent
5a4b4e924d
commit
6292a25b69
1 changed files with 30 additions and 127 deletions
|
@ -14,132 +14,35 @@ struct Error
|
||||||
};
|
};
|
||||||
|
|
||||||
static Error errortab[] = {
|
static Error errortab[] = {
|
||||||
{"Operation not permitted", EPERM},
|
{ "permitted", EPERM },
|
||||||
{"wstat prohibited", EPERM},
|
{ "permission", EACCES },
|
||||||
{"No such file or directory", ENOENT},
|
{ "access", EACCES },
|
||||||
{"file not found", ENOENT},
|
{ "exists", EEXIST },
|
||||||
{"Interrupted system call", EINTR},
|
{ "exist", ENOENT },
|
||||||
{"Input/output error", EIO},
|
{ "no such", ENOENT },
|
||||||
{"No such device or address", ENXIO},
|
{ "not found", ENOENT },
|
||||||
{"Argument list too long", E2BIG},
|
{ "input/output", EIO },
|
||||||
{"Bad file descriptor", EBADF},
|
{ "timeout", ETIMEDOUT },
|
||||||
{"Resource temporarily unavailable", EAGAIN},
|
{ "timed out", ETIMEDOUT },
|
||||||
{"Cannot allocate memory", ENOMEM},
|
{ "i/o", EIO },
|
||||||
{"Permission denied", EACCES},
|
{ "too long", E2BIG },
|
||||||
{"Bad address", EFAULT},
|
{ "interrupt", EINTR },
|
||||||
{"Block device required", ENOTBLK},
|
{ "no such", ENODEV },
|
||||||
{"Device or resource busy", EBUSY},
|
{ "bad file", EBADF },
|
||||||
{"File exists", EEXIST},
|
{ " fid ", EBADF },
|
||||||
{"Invalid cross-device link", EXDEV},
|
{ "temporar", EAGAIN },
|
||||||
{"No such device", ENODEV},
|
{ "memory", ENOMEM },
|
||||||
{"Not a directory", ENOTDIR},
|
{ "is a directory", EISDIR },
|
||||||
{"Is a directory", EISDIR},
|
{ "directory", ENOTDIR },
|
||||||
{"Invalid argument", EINVAL},
|
{ "argument", EINVAL },
|
||||||
{"Too many open files in system", ENFILE},
|
{ "pipe", EPIPE },
|
||||||
{"Too many open files", EMFILE},
|
{ "in use", EBUSY },
|
||||||
{"Text file busy", ETXTBSY},
|
{ "busy", EBUSY },
|
||||||
{"File too large", EFBIG},
|
{ "illegal", EINVAL },
|
||||||
{"No space left on device", ENOSPC},
|
{ "read-only", EROFS },
|
||||||
{"Illegal seek", ESPIPE},
|
{ "read only", EROFS },
|
||||||
{"Read-only file system", EROFS},
|
{ "proto", EPROTO },
|
||||||
{"Too many links", EMLINK},
|
{ "entry", ENOENT },
|
||||||
{"Broken pipe", EPIPE},
|
|
||||||
{"Numerical argument out of domain", EDOM},
|
|
||||||
{"Numerical result out of range", ERANGE},
|
|
||||||
{"Resource deadlock avoided", EDEADLK},
|
|
||||||
{"File name too long", ENAMETOOLONG},
|
|
||||||
{"No locks available", ENOLCK},
|
|
||||||
{"Function not implemented", ENOSYS},
|
|
||||||
{"Directory not empty", ENOTEMPTY},
|
|
||||||
{"Too many levels of symbolic links", ELOOP},
|
|
||||||
{"No message of desired type", ENOMSG},
|
|
||||||
{"Identifier removed", EIDRM},
|
|
||||||
{"No data available", ENODATA},
|
|
||||||
{"Machine is not on the network", ENONET},
|
|
||||||
{"Package not installed", ENOPKG},
|
|
||||||
{"Object is remote", EREMOTE},
|
|
||||||
{"Link has been severed", ENOLINK},
|
|
||||||
{"Communication error on send", ECOMM},
|
|
||||||
{"Protocol error", EPROTO},
|
|
||||||
{"Bad message", EBADMSG},
|
|
||||||
{"File descriptor in bad state", EBADFD},
|
|
||||||
{"Streams pipe error", ESTRPIPE},
|
|
||||||
{"Too many users", EUSERS},
|
|
||||||
{"Socket operation on non-socket", ENOTSOCK},
|
|
||||||
{"Message too long", EMSGSIZE},
|
|
||||||
{"Protocol not available", ENOPROTOOPT},
|
|
||||||
{"Protocol not supported", EPROTONOSUPPORT},
|
|
||||||
{"Socket type not supported", ESOCKTNOSUPPORT},
|
|
||||||
{"Operation not supported", EOPNOTSUPP},
|
|
||||||
{"Protocol family not supported", EPFNOSUPPORT},
|
|
||||||
{"Network is down", ENETDOWN},
|
|
||||||
{"Network is unreachable", ENETUNREACH},
|
|
||||||
{"Network dropped connection on reset", ENETRESET},
|
|
||||||
{"Software caused connection abort", ECONNABORTED},
|
|
||||||
{"Connection reset by peer", ECONNRESET},
|
|
||||||
{"No buffer space available", ENOBUFS},
|
|
||||||
{"Transport endpoint is already connected", EISCONN},
|
|
||||||
{"Transport endpoint is not connected", ENOTCONN},
|
|
||||||
{"Cannot send after transport endpoint shutdown", ESHUTDOWN},
|
|
||||||
{"Connection timed out", ETIMEDOUT},
|
|
||||||
{"Connection refused", ECONNREFUSED},
|
|
||||||
{"Host is down", EHOSTDOWN},
|
|
||||||
{"No route to host", EHOSTUNREACH},
|
|
||||||
{"Operation already in progress", EALREADY},
|
|
||||||
{"Operation now in progress", EINPROGRESS},
|
|
||||||
{"Is a named type file", EISNAM},
|
|
||||||
{"Remote I/O error", EREMOTEIO},
|
|
||||||
{"Disk quota exceeded", EDQUOT},
|
|
||||||
/* errors from fossil, vacfs, and u9fs */
|
|
||||||
{"fid unknown or out of range", EBADF},
|
|
||||||
{"permission denied", EACCES},
|
|
||||||
{"file does not exist", ENOENT},
|
|
||||||
{"authentication failed", ECONNREFUSED},
|
|
||||||
{"bad offset in directory read", ESPIPE},
|
|
||||||
{"bad use of fid", EBADF},
|
|
||||||
{"wstat can't convert between files and directories", EPERM},
|
|
||||||
{"directory is not empty", ENOTEMPTY},
|
|
||||||
{"file exists", EEXIST},
|
|
||||||
{"file already exists", EEXIST},
|
|
||||||
{"file or directory already exists", EEXIST},
|
|
||||||
{"fid already in use", EBADF},
|
|
||||||
{"file in use", ETXTBSY},
|
|
||||||
{"i/o error", EIO},
|
|
||||||
{"file already open for I/O", ETXTBSY},
|
|
||||||
{"illegal mode", EINVAL},
|
|
||||||
{"illegal name", ENAMETOOLONG},
|
|
||||||
{"not a directory", ENOTDIR},
|
|
||||||
{"not a member of proposed group", EPERM},
|
|
||||||
{"not owner", EACCES},
|
|
||||||
{"only owner can change group in wstat", EACCES},
|
|
||||||
{"read only file system", EROFS},
|
|
||||||
{"no access to special file", EPERM},
|
|
||||||
{"i/o count too large", EIO},
|
|
||||||
{"unknown group", EINVAL},
|
|
||||||
{"unknown user", EINVAL},
|
|
||||||
{"bogus wstat buffer", EPROTO},
|
|
||||||
{"exclusive use file already open", EAGAIN},
|
|
||||||
{"corrupted directory entry", EIO},
|
|
||||||
{"corrupted file entry", EIO},
|
|
||||||
{"corrupted block label", EIO},
|
|
||||||
{"corrupted meta data", EIO},
|
|
||||||
{"illegal offset", EINVAL},
|
|
||||||
{"illegal path element", ENOENT},
|
|
||||||
{"root of file system is corrupted", EIO},
|
|
||||||
{"corrupted super block", EIO},
|
|
||||||
{"protocol botch", EPROTO},
|
|
||||||
{"file system is full", ENOSPC},
|
|
||||||
{"file is in use", EAGAIN},
|
|
||||||
{"directory entry is not allocated", ENOENT},
|
|
||||||
{"file is read only", EROFS},
|
|
||||||
{"file has been removed", EIDRM},
|
|
||||||
{"only support truncation to zero length", EPERM},
|
|
||||||
{"cannot remove root", EPERM},
|
|
||||||
{"file too big", EFBIG},
|
|
||||||
{"venti i/o error", EIO},
|
|
||||||
/* these are not errors */
|
|
||||||
{"u9fs rhostsauth: no authentication required", 0},
|
|
||||||
{"u9fs authnone: no authentication required", 0}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -160,6 +63,6 @@ errstr2errno(void)
|
||||||
for(i=0; i<nelem(errortab); i++)
|
for(i=0; i<nelem(errortab); i++)
|
||||||
if(errortab[i].len <= len && cistrstr(e, errortab[i].text))
|
if(errortab[i].len <= len && cistrstr(e, errortab[i].text))
|
||||||
return errortab[i].err;
|
return errortab[i].err;
|
||||||
return ERANGE; /* who knows? */
|
return ERANGE; /* who knows - be blatantly wrong */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue