staticconstchar *const message_table[] = {
[EPERM] = "Operation not permitted",
[ENOENT] = "No such file or directory",
[ESRCH] = "No such process",
[EINTR] = "Interrupted system call",
[EIO] = "Input/output error",
[ENXIO] = "No such device or address",
[E2BIG] = "Argument list too long",
[ENOEXEC] = "Exec format error",
[EBADF] = "Bad file descriptor",
[ECHILD] = "No child processes",
[EAGAIN] = "Resource temporarily unavailable",
[ENOMEM] = "Cannot allocate memory",
[EACCES] = "Permission denied",
[EFAULT] = "Bad address",
[ENOTBLK] = "Block device required",
[EBUSY] = "Device or resource busy",
[EEXIST] = "File exists",
[EXDEV] = "Invalid cross-device link",
[ENODEV] = "No such device",
[ENOTDIR] = "Not a directory",
[EISDIR] = "Is a directory",
[EINVAL] = "Invalid argument",
[ENFILE] = "Too many open files in system",
[EMFILE] = "Too many open files",
[ENOTTY] = "Inappropriate ioctl for device",
[ETXTBSY] = "Text file busy",
[EFBIG] = "File too large",
[ENOSPC] = "No space left on device",
[ESPIPE] = "Illegal seek",
[EROFS] = "Read-only file system",
[EMLINK] = "Too many links",
[EPIPE] = "Broken pipe",
[EDOM] = "Numerical argument out of domain",
[ERANGE] = "Numerical result out of range"
};
staticconststruct error_info error_list[] = {
{ "UDS_OVERFLOW", "Index overflow" },
{ "UDS_INVALID_ARGUMENT", "Invalid argument passed to internal routine" },
{ "UDS_BAD_STATE", "UDS data structures are in an invalid state" },
{ "UDS_DUPLICATE_NAME", "Attempt to enter the same name into a delta index twice" },
{ "UDS_ASSERTION_FAILED", "Assertion failed" },
{ "UDS_QUEUED", "Request queued" },
{ "UDS_ALREADY_REGISTERED", "Error range already registered" },
{ "UDS_OUT_OF_RANGE", "Cannot access data outside specified limits" },
{ "UDS_DISABLED", "UDS library context is disabled" },
{ "UDS_UNSUPPORTED_VERSION", "Unsupported version" },
{ "UDS_CORRUPT_DATA", "Some index structure is corrupt" },
{ "UDS_NO_INDEX", "No index found" },
{ "UDS_INDEX_NOT_SAVED_CLEANLY", "Index not saved cleanly" },
};
struct error_block { constchar *name; int base; int last; int max; conststruct error_info *infos;
};
/* Get the error info for an error number. Also returns the name of the error block, if known. */ staticconstchar *get_error_info(int errnum, conststruct error_info **info_ptr)
{ struct error_block *block;
/* 0 is success, and negative values are already system error codes. */ if (likely(error <= 0)) return error;
if (error < 1024) { /* This is probably an errno from userspace. */ return -error;
}
/* Internal UDS errors */ switch (error) { case UDS_NO_INDEX: case UDS_CORRUPT_DATA: /* The index doesn't exist or can't be recovered. */ return -ENOENT;
case UDS_INDEX_NOT_SAVED_CLEANLY: case UDS_UNSUPPORTED_VERSION: /* *Theindexexists,butcan'tbeloaded.Telltheclientitexistssotheydon't *destroyitinadvertently.
*/ return -EEXIST;
case UDS_DISABLED: /* The session is unusable; only returned by requests. */ return -EIO;
default: /* Translate an unexpected error into something generic. */
vdo_log_info("%s: mapping status code %d (%s: %s) to -EIO",
__func__, error,
uds_string_error_name(error, error_name, sizeof(error_name)),
uds_string_error(error, error_message, sizeof(error_message))); return -EIO;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.