Compare commits
No commits in common. "1b98ae3ecdb07d190e6f7cb8ca30be5442ee4d72" and "b78fffd9b0358cf2e64755e3a2e08ff286773a67" have entirely different histories.
1b98ae3ecd
...
b78fffd9b0
@ -2,275 +2,140 @@
|
|||||||
#[repr(i32)]
|
#[repr(i32)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||||
pub enum Errno {
|
pub enum Errno {
|
||||||
/// Operation not permitted
|
|
||||||
EPERM = 1,
|
EPERM = 1,
|
||||||
/// No such file or directory
|
|
||||||
ENOENT = 2,
|
ENOENT = 2,
|
||||||
/// No such process
|
|
||||||
ESRCH = 3,
|
ESRCH = 3,
|
||||||
/// Interrupted system call
|
|
||||||
EINTR = 4,
|
EINTR = 4,
|
||||||
/// Input/output error
|
|
||||||
EIO = 5,
|
EIO = 5,
|
||||||
/// No such device or address
|
|
||||||
ENXIO = 6,
|
ENXIO = 6,
|
||||||
/// Argument list too long
|
|
||||||
E2BIG = 7,
|
E2BIG = 7,
|
||||||
/// Exec format error
|
|
||||||
ENOEXEC = 8,
|
ENOEXEC = 8,
|
||||||
/// Bad file descriptor
|
|
||||||
EBADF = 9,
|
EBADF = 9,
|
||||||
/// No child processes
|
|
||||||
ECHILD = 10,
|
ECHILD = 10,
|
||||||
/// Resource temporarily unavailable
|
|
||||||
EWOULDBLOCK = 11,
|
EWOULDBLOCK = 11,
|
||||||
/// Cannot allocate memory
|
|
||||||
ENOMEM = 12,
|
ENOMEM = 12,
|
||||||
/// Permission denied
|
|
||||||
EACCES = 13,
|
EACCES = 13,
|
||||||
/// Bad address
|
|
||||||
EFAULT = 14,
|
EFAULT = 14,
|
||||||
/// Block device required
|
|
||||||
ENOTBLK = 15,
|
ENOTBLK = 15,
|
||||||
/// Device or resource busy
|
|
||||||
EBUSY = 16,
|
EBUSY = 16,
|
||||||
/// File exists
|
|
||||||
EEXIST = 17,
|
EEXIST = 17,
|
||||||
/// Invalid cross-device link
|
|
||||||
EXDEV = 18,
|
EXDEV = 18,
|
||||||
/// No such device
|
|
||||||
ENODEV = 19,
|
ENODEV = 19,
|
||||||
/// Not a directory
|
|
||||||
ENOTDIR = 20,
|
ENOTDIR = 20,
|
||||||
/// Is a directory
|
|
||||||
EISDIR = 21,
|
EISDIR = 21,
|
||||||
/// Invalid argument
|
|
||||||
EINVAL = 22,
|
EINVAL = 22,
|
||||||
/// Too many open files in system
|
|
||||||
ENFILE = 23,
|
ENFILE = 23,
|
||||||
/// Too many open files
|
|
||||||
EMFILE = 24,
|
EMFILE = 24,
|
||||||
/// Inappropriate ioctl for device
|
|
||||||
ENOTTY = 25,
|
ENOTTY = 25,
|
||||||
/// Text file busy
|
|
||||||
ETXTBSY = 26,
|
ETXTBSY = 26,
|
||||||
/// File too large
|
|
||||||
EFBIG = 27,
|
EFBIG = 27,
|
||||||
/// No space left on device
|
|
||||||
ENOSPC = 28,
|
ENOSPC = 28,
|
||||||
/// Illegal seek
|
|
||||||
ESPIPE = 29,
|
ESPIPE = 29,
|
||||||
/// Read-only file system
|
|
||||||
EROFS = 30,
|
EROFS = 30,
|
||||||
/// Too many links
|
|
||||||
EMLINK = 31,
|
EMLINK = 31,
|
||||||
/// Broken pipe
|
|
||||||
EPIPE = 32,
|
EPIPE = 32,
|
||||||
/// Numerical argument out of domain
|
|
||||||
EDOM = 33,
|
EDOM = 33,
|
||||||
/// Numerical result out of range
|
|
||||||
ERANGE = 34,
|
ERANGE = 34,
|
||||||
/// Resource deadlock avoided
|
|
||||||
EDEADLK = 35,
|
EDEADLK = 35,
|
||||||
/// File name too long
|
|
||||||
ENAMETOOLONG = 36,
|
ENAMETOOLONG = 36,
|
||||||
/// No locks available
|
|
||||||
ENOLCK = 37,
|
ENOLCK = 37,
|
||||||
/// Function not implemented
|
|
||||||
ENOSYS = 38,
|
ENOSYS = 38,
|
||||||
/// Directory not empty
|
|
||||||
ENOTEMPTY = 39,
|
ENOTEMPTY = 39,
|
||||||
/// Too many levels of symbolic links
|
|
||||||
ELOOP = 40,
|
ELOOP = 40,
|
||||||
/// No message of desired type
|
|
||||||
ENOMSG = 42,
|
ENOMSG = 42,
|
||||||
/// Identifier removed
|
|
||||||
EIDRM = 43,
|
EIDRM = 43,
|
||||||
/// Channel number out of range
|
|
||||||
ECHRNG = 44,
|
ECHRNG = 44,
|
||||||
/// Level 2 not synchronized
|
|
||||||
EL2NSYNC = 45,
|
EL2NSYNC = 45,
|
||||||
/// Level 3 halted
|
|
||||||
EL3HLT = 46,
|
EL3HLT = 46,
|
||||||
/// Level 3 reset
|
|
||||||
EL3RST = 47,
|
EL3RST = 47,
|
||||||
/// Link number out of range
|
|
||||||
ELNRNG = 48,
|
ELNRNG = 48,
|
||||||
/// Protocol driver not attached
|
|
||||||
EUNATCH = 49,
|
EUNATCH = 49,
|
||||||
/// No CSI structure available
|
|
||||||
ENOCSI = 50,
|
ENOCSI = 50,
|
||||||
/// Level 2 halted
|
|
||||||
EL2HLT = 51,
|
EL2HLT = 51,
|
||||||
/// Invalid exchange
|
|
||||||
EBADE = 52,
|
EBADE = 52,
|
||||||
/// Invalid request descriptor
|
|
||||||
EBADR = 53,
|
EBADR = 53,
|
||||||
/// Exchange full
|
|
||||||
EXFULL = 54,
|
EXFULL = 54,
|
||||||
/// No anode
|
|
||||||
ENOANO = 55,
|
ENOANO = 55,
|
||||||
/// Invalid request code
|
|
||||||
EBADRQC = 56,
|
EBADRQC = 56,
|
||||||
/// Invalid slot
|
|
||||||
EBADSLT = 57,
|
EBADSLT = 57,
|
||||||
/// Bad font file format
|
|
||||||
EBFONT = 59,
|
EBFONT = 59,
|
||||||
/// Device not a stream
|
|
||||||
ENOSTR = 60,
|
ENOSTR = 60,
|
||||||
/// No data available
|
|
||||||
ENODATA = 61,
|
ENODATA = 61,
|
||||||
/// Timer expired
|
|
||||||
ETIME = 62,
|
ETIME = 62,
|
||||||
/// Out of streams resources
|
|
||||||
ENOSR = 63,
|
ENOSR = 63,
|
||||||
/// Machine is not on the network
|
|
||||||
ENONET = 64,
|
ENONET = 64,
|
||||||
/// Package not installed
|
|
||||||
ENOPKG = 65,
|
ENOPKG = 65,
|
||||||
/// Object is remote
|
|
||||||
EREMOTE = 66,
|
EREMOTE = 66,
|
||||||
/// Link has been severed
|
|
||||||
ENOLINK = 67,
|
ENOLINK = 67,
|
||||||
/// Advertise error
|
|
||||||
EADV = 68,
|
EADV = 68,
|
||||||
/// Srmount error
|
|
||||||
ESRMNT = 69,
|
ESRMNT = 69,
|
||||||
/// Communication error on send
|
|
||||||
ECOMM = 70,
|
ECOMM = 70,
|
||||||
/// Protocol error
|
|
||||||
EPROTO = 71,
|
EPROTO = 71,
|
||||||
/// Multihop attempted
|
|
||||||
EMULTIHOP = 72,
|
EMULTIHOP = 72,
|
||||||
/// RFS specific error
|
|
||||||
EDOTDOT = 73,
|
EDOTDOT = 73,
|
||||||
/// Bad message
|
|
||||||
EBADMSG = 74,
|
EBADMSG = 74,
|
||||||
/// Value too large for defined data type
|
|
||||||
EOVERFLOW = 75,
|
EOVERFLOW = 75,
|
||||||
/// Name not unique on network
|
|
||||||
ENOTUNIQ = 76,
|
ENOTUNIQ = 76,
|
||||||
/// File descriptor in bad state
|
|
||||||
EBADFD = 77,
|
EBADFD = 77,
|
||||||
/// Remote address changed
|
|
||||||
EREMCHG = 78,
|
EREMCHG = 78,
|
||||||
/// Can not access a needed shared library
|
|
||||||
ELIBACC = 79,
|
ELIBACC = 79,
|
||||||
/// Accessing a corrupted shared library
|
|
||||||
ELIBBAD = 80,
|
ELIBBAD = 80,
|
||||||
/// .lib section in a.out corrupted
|
|
||||||
ELIBSCN = 81,
|
ELIBSCN = 81,
|
||||||
/// Attempting to link in too many shared libraries
|
|
||||||
ELIBMAX = 82,
|
ELIBMAX = 82,
|
||||||
/// Cannot exec a shared library directly
|
|
||||||
ELIBEXEC = 83,
|
ELIBEXEC = 83,
|
||||||
/// Invalid or incomplete multibyte or wide character
|
|
||||||
EILSEQ = 84,
|
EILSEQ = 84,
|
||||||
/// Interrupted system call should be restarted
|
|
||||||
ERESTART = 85,
|
ERESTART = 85,
|
||||||
/// Streams pipe error
|
|
||||||
ESTRPIPE = 86,
|
ESTRPIPE = 86,
|
||||||
/// Too many users
|
|
||||||
EUSERS = 87,
|
EUSERS = 87,
|
||||||
/// Socket operation on non-socket
|
|
||||||
ENOTSOCK = 88,
|
ENOTSOCK = 88,
|
||||||
/// Destination address required
|
|
||||||
EDESTADDRREQ = 89,
|
EDESTADDRREQ = 89,
|
||||||
/// Message too long
|
|
||||||
EMSGSIZE = 90,
|
EMSGSIZE = 90,
|
||||||
/// Protocol wrong type for socket
|
|
||||||
EPROTOTYPE = 91,
|
EPROTOTYPE = 91,
|
||||||
/// Protocol not available
|
|
||||||
ENOPROTOOPT = 92,
|
ENOPROTOOPT = 92,
|
||||||
/// Protocol not supported
|
|
||||||
EPROTONOSUPPORT = 93,
|
EPROTONOSUPPORT = 93,
|
||||||
/// Socket type not supported
|
|
||||||
ESOCKTNOSUPPORT = 94,
|
ESOCKTNOSUPPORT = 94,
|
||||||
/// Operation not supported
|
|
||||||
ENOTSUP = 95,
|
ENOTSUP = 95,
|
||||||
/// Protocol family not supported
|
|
||||||
EPFNOSUPPORT = 96,
|
EPFNOSUPPORT = 96,
|
||||||
/// Address family not supported by protocol
|
|
||||||
EAFNOSUPPORT = 97,
|
EAFNOSUPPORT = 97,
|
||||||
/// Address already in use
|
|
||||||
EADDRINUSE = 98,
|
EADDRINUSE = 98,
|
||||||
/// Cannot assign requested address
|
|
||||||
EADDRNOTAVAIL = 99,
|
EADDRNOTAVAIL = 99,
|
||||||
/// Network is down
|
|
||||||
ENETDOWN = 100,
|
ENETDOWN = 100,
|
||||||
/// Network is unreachable
|
|
||||||
ENETUNREACH = 101,
|
ENETUNREACH = 101,
|
||||||
/// Network dropped connection on reset
|
|
||||||
ENETRESET = 102,
|
ENETRESET = 102,
|
||||||
/// Software caused connection abort
|
|
||||||
ECONNABORTED = 103,
|
ECONNABORTED = 103,
|
||||||
/// Connection reset by peer
|
|
||||||
ECONNRESET = 104,
|
ECONNRESET = 104,
|
||||||
/// No buffer space available
|
|
||||||
ENOBUFS = 105,
|
ENOBUFS = 105,
|
||||||
/// Transport endpoint is already connected
|
|
||||||
EISCONN = 106,
|
EISCONN = 106,
|
||||||
/// Transport endpoint is not connected
|
|
||||||
ENOTCONN = 107,
|
ENOTCONN = 107,
|
||||||
/// Cannot send after transport endpoint shutdown
|
|
||||||
ESHUTDOWN = 108,
|
ESHUTDOWN = 108,
|
||||||
/// Too many references: cannot splice
|
|
||||||
ETOOMANYREFS = 109,
|
ETOOMANYREFS = 109,
|
||||||
/// Connection timed out
|
|
||||||
ETIMEDOUT = 110,
|
ETIMEDOUT = 110,
|
||||||
/// Connection refused
|
|
||||||
ECONNREFUSED = 111,
|
ECONNREFUSED = 111,
|
||||||
/// Host is down
|
|
||||||
EHOSTDOWN = 112,
|
EHOSTDOWN = 112,
|
||||||
/// No route to host
|
|
||||||
EHOSTUNREACH = 113,
|
EHOSTUNREACH = 113,
|
||||||
/// Operation already in progress
|
|
||||||
EALREADY = 114,
|
EALREADY = 114,
|
||||||
/// Operation now in progress
|
|
||||||
EINPROGRESS = 115,
|
EINPROGRESS = 115,
|
||||||
/// Stale file handle
|
|
||||||
ESTALE = 116,
|
ESTALE = 116,
|
||||||
/// Structure needs cleaning
|
|
||||||
EUCLEAN = 117,
|
EUCLEAN = 117,
|
||||||
/// Not a XENIX named type file
|
|
||||||
ENOTNAM = 118,
|
ENOTNAM = 118,
|
||||||
/// No XENIX semaphores available
|
|
||||||
ENAVAIL = 119,
|
ENAVAIL = 119,
|
||||||
/// Is a named type file
|
|
||||||
EISNAM = 120,
|
EISNAM = 120,
|
||||||
/// Remote I/O error
|
|
||||||
EREMOTEIO = 121,
|
EREMOTEIO = 121,
|
||||||
/// Disk quota exceeded
|
|
||||||
EDQUOT = 122,
|
EDQUOT = 122,
|
||||||
/// No medium found
|
|
||||||
ENOMEDIUM = 123,
|
ENOMEDIUM = 123,
|
||||||
/// Wrong medium type
|
|
||||||
EMEDIUMTYPE = 124,
|
EMEDIUMTYPE = 124,
|
||||||
/// Operation canceled
|
|
||||||
ECANCELED = 125,
|
ECANCELED = 125,
|
||||||
/// Required key not available
|
|
||||||
ENOKEY = 126,
|
ENOKEY = 126,
|
||||||
/// Key has expired
|
|
||||||
EKEYEXPIRED = 127,
|
EKEYEXPIRED = 127,
|
||||||
/// Key has been revoked
|
|
||||||
EKEYREVOKED = 128,
|
EKEYREVOKED = 128,
|
||||||
/// Key was rejected by service
|
|
||||||
EKEYREJECTED = 129,
|
EKEYREJECTED = 129,
|
||||||
/// Owner died
|
|
||||||
EOWNERDEAD = 130,
|
EOWNERDEAD = 130,
|
||||||
/// State not recoverable
|
|
||||||
ENOTRECOVERABLE = 131,
|
ENOTRECOVERABLE = 131,
|
||||||
/// Operation not possible due to RF-kill
|
|
||||||
ERFKILL = 132,
|
ERFKILL = 132,
|
||||||
/// Memory page has hardware error
|
|
||||||
EHWPOISON = 133,
|
EHWPOISON = 133,
|
||||||
/// Resource temporarily unavailable
|
|
||||||
EAGAIN = 134,
|
EAGAIN = 134,
|
||||||
/// Unexpected EOF
|
|
||||||
EEOF = 135,
|
EEOF = 135,
|
||||||
/// Invalid data
|
|
||||||
EINVALDAT = 136,
|
EINVALDAT = 136,
|
||||||
/// Write zero
|
|
||||||
EWRZERO = 137,
|
EWRZERO = 137,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,141 +327,141 @@ impl crate::fmt::Display for Errno {
|
|||||||
fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> Result<(), crate::fmt::Error> {
|
fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> Result<(), crate::fmt::Error> {
|
||||||
use Errno::*;
|
use Errno::*;
|
||||||
let errno_name = match self {
|
let errno_name = match self {
|
||||||
EPERM => "EPERM",
|
EPERM => "Operation not permitted",
|
||||||
ENOENT => "ENOENT",
|
ENOENT => "No such file or directory",
|
||||||
ESRCH => "ESRCH",
|
ESRCH => "No such process",
|
||||||
EINTR => "EINTR",
|
EINTR => "Interrupted system call",
|
||||||
EIO => "EIO",
|
EIO => "Input/output error",
|
||||||
ENXIO => "ENXIO",
|
ENXIO => "No such device or address",
|
||||||
E2BIG => "E2BIG",
|
E2BIG => "Argument list too long",
|
||||||
ENOEXEC => "ENOEXEC",
|
ENOEXEC => "Exec format error",
|
||||||
EBADF => "EBADF",
|
EBADF => "Bad file descriptor",
|
||||||
ECHILD => "ECHILD",
|
ECHILD => "No child processes",
|
||||||
EAGAIN => "EAGAIN",
|
EAGAIN => "Resource temporarily unavailable",
|
||||||
EWOULDBLOCK => "EWOULDBLOCK",
|
EWOULDBLOCK => "Resource temporarily unavailable",
|
||||||
ENOMEM => "ENOMEM",
|
ENOMEM => "Cannot allocate memory",
|
||||||
EACCES => "EACCES",
|
EACCES => "Permission denied",
|
||||||
EFAULT => "EFAULT",
|
EFAULT => "Bad address",
|
||||||
ENOTBLK => "ENOTBLK",
|
ENOTBLK => "Block device required",
|
||||||
EBUSY => "EBUSY",
|
EBUSY => "Device or resource busy",
|
||||||
EEXIST => "EEXIST",
|
EEXIST => "File exists",
|
||||||
EXDEV => "EXDEV",
|
EXDEV => "Invalid cross-device link",
|
||||||
ENODEV => "ENODEV",
|
ENODEV => "No such device",
|
||||||
ENOTDIR => "ENOTDIR",
|
ENOTDIR => "Not a directory",
|
||||||
EISDIR => "EISDIR",
|
EISDIR => "Is a directory",
|
||||||
EINVAL => "EINVAL",
|
EINVAL => "Invalid argument",
|
||||||
ENFILE => "ENFILE",
|
ENFILE => "Too many open files in system",
|
||||||
EMFILE => "EMFILE",
|
EMFILE => "Too many open files",
|
||||||
ENOTTY => "ENOTTY",
|
ENOTTY => "Inappropriate ioctl for device",
|
||||||
ETXTBSY => "ETXTBSY",
|
ETXTBSY => "Text file busy",
|
||||||
EFBIG => "EFBIG",
|
EFBIG => "File too large",
|
||||||
ENOSPC => "ENOSPC",
|
ENOSPC => "No space left on device",
|
||||||
ESPIPE => "ESPIPE",
|
ESPIPE => "Illegal seek",
|
||||||
EROFS => "EROFS",
|
EROFS => "Read-only file system",
|
||||||
EMLINK => "EMLINK",
|
EMLINK => "Too many links",
|
||||||
EPIPE => "EPIPE",
|
EPIPE => "Broken pipe",
|
||||||
EDOM => "EDOM",
|
EDOM => "Numerical argument out of domain",
|
||||||
ERANGE => "ERANGE",
|
ERANGE => "Numerical result out of range",
|
||||||
EDEADLK => "EDEADLK",
|
EDEADLK => "Resource deadlock avoided",
|
||||||
ENAMETOOLONG => "ENAMETOOLONG",
|
ENAMETOOLONG => "File name too long",
|
||||||
ENOLCK => "ENOLCK",
|
ENOLCK => "No locks available",
|
||||||
ENOSYS => "ENOSYS",
|
ENOSYS => "Function not implemented",
|
||||||
ENOTEMPTY => "ENOTEMPTY",
|
ENOTEMPTY => "Directory not empty",
|
||||||
ELOOP => "ELOOP",
|
ELOOP => "Too many levels of symbolic links",
|
||||||
ENOMSG => "ENOMSG",
|
ENOMSG => "No message of desired type",
|
||||||
EIDRM => "EIDRM",
|
EIDRM => "Identifier removed",
|
||||||
ECHRNG => "ECHRNG",
|
ECHRNG => "Channel number out of range",
|
||||||
EL2NSYNC => "EL2NSYNC",
|
EL2NSYNC => "Level 2 not synchronized",
|
||||||
EL3HLT => "EL3HLT",
|
EL3HLT => "Level 3 halted",
|
||||||
EL3RST => "EL3RST",
|
EL3RST => "Level 3 reset",
|
||||||
ELNRNG => "ELNRNG",
|
ELNRNG => "Link number out of range",
|
||||||
EUNATCH => "EUNATCH",
|
EUNATCH => "Protocol driver not attached",
|
||||||
ENOCSI => "ENOCSI",
|
ENOCSI => "No CSI structure available",
|
||||||
EL2HLT => "EL2HLT",
|
EL2HLT => "Level 2 halted",
|
||||||
EBADE => "EBADE",
|
EBADE => "Invalid exchange",
|
||||||
EBADR => "EBADR",
|
EBADR => "Invalid request descriptor",
|
||||||
EXFULL => "EXFULL",
|
EXFULL => "Exchange full",
|
||||||
ENOANO => "ENOANO",
|
ENOANO => "No anode",
|
||||||
EBADRQC => "EBADRQC",
|
EBADRQC => "Invalid request code",
|
||||||
EBADSLT => "EBADSLT",
|
EBADSLT => "Invalid slot",
|
||||||
EBFONT => "EBFONT",
|
EBFONT => "Bad font file format",
|
||||||
ENOSTR => "ENOSTR",
|
ENOSTR => "Device not a stream",
|
||||||
ENODATA => "ENODATA",
|
ENODATA => "No data available",
|
||||||
ETIME => "ETIME",
|
ETIME => "Timer expired",
|
||||||
ENOSR => "ENOSR",
|
ENOSR => "Out of streams resources",
|
||||||
ENONET => "ENONET",
|
ENONET => "Machine is not on the network",
|
||||||
ENOPKG => "ENOPKG",
|
ENOPKG => "Package not installed",
|
||||||
EREMOTE => "EREMOTE",
|
EREMOTE => "Object is remote",
|
||||||
ENOLINK => "ENOLINK",
|
ENOLINK => "Link has been severed",
|
||||||
EADV => "EADV",
|
EADV => "Advertise error",
|
||||||
ESRMNT => "ESRMNT",
|
ESRMNT => "Srmount error",
|
||||||
ECOMM => "ECOMM",
|
ECOMM => "Communication error on send",
|
||||||
EPROTO => "EPROTO",
|
EPROTO => "Protocol error",
|
||||||
EMULTIHOP => "EMULTIHOP",
|
EMULTIHOP => "Multihop attempted",
|
||||||
EDOTDOT => "EDOTDOT",
|
EDOTDOT => "RFS specific error",
|
||||||
EBADMSG => "EBADMSG",
|
EBADMSG => "Bad message",
|
||||||
EOVERFLOW => "EOVERFLOW",
|
EOVERFLOW => "Value too large for defined data type",
|
||||||
ENOTUNIQ => "ENOTUNIQ",
|
ENOTUNIQ => "Name not unique on network",
|
||||||
EBADFD => "EBADFD",
|
EBADFD => "File descriptor in bad state",
|
||||||
EREMCHG => "EREMCHG",
|
EREMCHG => "Remote address changed",
|
||||||
ELIBACC => "ELIBACC",
|
ELIBACC => "Can not access a needed shared library",
|
||||||
ELIBBAD => "ELIBBAD",
|
ELIBBAD => "Accessing a corrupted shared library",
|
||||||
ELIBSCN => "ELIBSCN",
|
ELIBSCN => ".lib section in a.out corrupted",
|
||||||
ELIBMAX => "ELIBMAX",
|
ELIBMAX => "Attempting to link in too many shared libraries",
|
||||||
ELIBEXEC => "ELIBEXEC",
|
ELIBEXEC => "Cannot exec a shared library directly",
|
||||||
EILSEQ => "EILSEQ",
|
EILSEQ => "Invalid or incomplete multibyte or wide character",
|
||||||
ERESTART => "ERESTART",
|
ERESTART => "Interrupted system call should be restarted",
|
||||||
ESTRPIPE => "ESTRPIPE",
|
ESTRPIPE => "Streams pipe error",
|
||||||
EUSERS => "EUSERS",
|
EUSERS => "Too many users",
|
||||||
ENOTSOCK => "ENOTSOCK",
|
ENOTSOCK => "Socket operation on non-socket",
|
||||||
EDESTADDRREQ => "EDESTADDRREQ",
|
EDESTADDRREQ => "Destination address required",
|
||||||
EMSGSIZE => "EMSGSIZE",
|
EMSGSIZE => "Message too long",
|
||||||
EPROTOTYPE => "EPROTOTYPE",
|
EPROTOTYPE => "Protocol wrong type for socket",
|
||||||
ENOPROTOOPT => "ENOPROTOOPT",
|
ENOPROTOOPT => "Protocol not available",
|
||||||
EPROTONOSUPPORT => "EPROTONOSUPPORT",
|
EPROTONOSUPPORT => "Protocol not supported",
|
||||||
ESOCKTNOSUPPORT => "ESOCKTNOSUPPORT",
|
ESOCKTNOSUPPORT => "Socket type not supported",
|
||||||
ENOTSUP => "ENOTSUP",
|
ENOTSUP => "Operation not supported",
|
||||||
EPFNOSUPPORT => "EPFNOSUPPORT",
|
EPFNOSUPPORT => "Protocol family not supported",
|
||||||
EAFNOSUPPORT => "EAFNOSUPPORT",
|
EAFNOSUPPORT => "Address family not supported by protocol",
|
||||||
EADDRINUSE => "EADDRINUSE",
|
EADDRINUSE => "Address already in use",
|
||||||
EADDRNOTAVAIL => "EADDRNOTAVAIL",
|
EADDRNOTAVAIL => "Cannot assign requested address",
|
||||||
ENETDOWN => "ENETDOWN",
|
ENETDOWN => "Network is down",
|
||||||
ENETUNREACH => "ENETUNREACH",
|
ENETUNREACH => "Network is unreachable",
|
||||||
ENETRESET => "ENETRESET",
|
ENETRESET => "Network dropped connection on reset",
|
||||||
ECONNABORTED => "ECONNABORTED",
|
ECONNABORTED => "Software caused connection abort",
|
||||||
ECONNRESET => "ECONNRESET",
|
ECONNRESET => "Connection reset by peer",
|
||||||
ENOBUFS => "ENOBUFS",
|
ENOBUFS => "No buffer space available",
|
||||||
EISCONN => "EISCONN",
|
EISCONN => "Transport endpoint is already connected",
|
||||||
ENOTCONN => "ENOTCONN",
|
ENOTCONN => "Transport endpoint is not connected",
|
||||||
ESHUTDOWN => "ESHUTDOWN",
|
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
|
||||||
ETOOMANYREFS => "ETOOMANYREFS",
|
ETOOMANYREFS => "Too many references: cannot splice",
|
||||||
ETIMEDOUT => "ETIMEDOUT",
|
ETIMEDOUT => "Connection timed out",
|
||||||
ECONNREFUSED => "ECONNREFUSED",
|
ECONNREFUSED => "Connection refused",
|
||||||
EHOSTDOWN => "EHOSTDOWN",
|
EHOSTDOWN => "Host is down",
|
||||||
EHOSTUNREACH => "EHOSTUNREACH",
|
EHOSTUNREACH => "No route to host",
|
||||||
EALREADY => "EALREADY",
|
EALREADY => "Operation already in progress",
|
||||||
EINPROGRESS => "EINPROGRESS",
|
EINPROGRESS => "Operation now in progress",
|
||||||
ESTALE => "ESTALE",
|
ESTALE => "Stale file handle",
|
||||||
EUCLEAN => "EUCLEAN",
|
EUCLEAN => "Structure needs cleaning",
|
||||||
ENOTNAM => "ENOTNAM",
|
ENOTNAM => "Not a XENIX named type file",
|
||||||
ENAVAIL => "ENAVAIL",
|
ENAVAIL => "No XENIX semaphores available",
|
||||||
EISNAM => "EISNAM",
|
EISNAM => "Is a named type file",
|
||||||
EREMOTEIO => "EREMOTEIO",
|
EREMOTEIO => "Remote I/O error",
|
||||||
EDQUOT => "EDQUOT",
|
EDQUOT => "Disk quota exceeded",
|
||||||
ENOMEDIUM => "ENOMEDIUM",
|
ENOMEDIUM => "No medium found",
|
||||||
EMEDIUMTYPE => "EMEDIUMTYPE",
|
EMEDIUMTYPE => "Wrong medium type",
|
||||||
ECANCELED => "ECANCELED",
|
ECANCELED => "Operation canceled",
|
||||||
ENOKEY => "ENOKEY",
|
ENOKEY => "Required key not available",
|
||||||
EKEYEXPIRED => "EKEYEXPIRED",
|
EKEYEXPIRED => "Key has expired",
|
||||||
EKEYREVOKED => "EKEYREVOKED",
|
EKEYREVOKED => "Key has been revoked",
|
||||||
EKEYREJECTED => "EKEYREJECTED",
|
EKEYREJECTED => "Key was rejected by service",
|
||||||
EOWNERDEAD => "EOWNERDEAD",
|
EOWNERDEAD => "Owner died",
|
||||||
ENOTRECOVERABLE => "ENOTRECOVERABLE",
|
ENOTRECOVERABLE => "State not recoverable",
|
||||||
ERFKILL => "ERFKILL",
|
ERFKILL => "Operation not possible due to RF-kill",
|
||||||
EHWPOISON => "EHWPOISON",
|
EHWPOISON => "Memory page has hardware error",
|
||||||
EEOF => "EEOF",
|
EEOF => "Unexpected EOF",
|
||||||
EINVALDAT => "EINVALDAT",
|
EINVALDAT => "Invalid data",
|
||||||
EWRZERO => "EWRZERO",
|
EWRZERO => "Write zero",
|
||||||
};
|
};
|
||||||
f.write_str(errno_name)
|
f.write_str(errno_name)
|
||||||
}
|
}
|
||||||
|
@ -41,8 +41,3 @@ pub fn irq_register(irq: u8) -> Result<(), ()> {
|
|||||||
pub fn wake_new(pid: u64) -> Result<(), ()> {
|
pub fn wake_new(pid: u64) -> Result<(), ()> {
|
||||||
syscalls::wake_new(pid)
|
syscalls::wake_new(pid)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "mikros", since = "1.80.0")]
|
|
||||||
pub fn clear_exited(pid: u64) -> Result<(), ()> {
|
|
||||||
syscalls::clear_exited(pid)
|
|
||||||
}
|
|
||||||
|
@ -12,145 +12,7 @@ pub fn errno() -> Errno {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn error_string(errno: Errno) -> String {
|
pub fn error_string(errno: Errno) -> String {
|
||||||
use Errno::*;
|
errno.to_string()
|
||||||
match errno {
|
|
||||||
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",
|
|
||||||
EWOULDBLOCK => "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",
|
|
||||||
EDEADLK => "Resource deadlock avoided",
|
|
||||||
ENAMETOOLONG => "File name too long",
|
|
||||||
ENOLCK => "No locks available",
|
|
||||||
ENOSYS => "Function not implemented",
|
|
||||||
ENOTEMPTY => "Directory not empty",
|
|
||||||
ELOOP => "Too many levels of symbolic links",
|
|
||||||
ENOMSG => "No message of desired type",
|
|
||||||
EIDRM => "Identifier removed",
|
|
||||||
ECHRNG => "Channel number out of range",
|
|
||||||
EL2NSYNC => "Level 2 not synchronized",
|
|
||||||
EL3HLT => "Level 3 halted",
|
|
||||||
EL3RST => "Level 3 reset",
|
|
||||||
ELNRNG => "Link number out of range",
|
|
||||||
EUNATCH => "Protocol driver not attached",
|
|
||||||
ENOCSI => "No CSI structure available",
|
|
||||||
EL2HLT => "Level 2 halted",
|
|
||||||
EBADE => "Invalid exchange",
|
|
||||||
EBADR => "Invalid request descriptor",
|
|
||||||
EXFULL => "Exchange full",
|
|
||||||
ENOANO => "No anode",
|
|
||||||
EBADRQC => "Invalid request code",
|
|
||||||
EBADSLT => "Invalid slot",
|
|
||||||
EBFONT => "Bad font file format",
|
|
||||||
ENOSTR => "Device not a stream",
|
|
||||||
ENODATA => "No data available",
|
|
||||||
ETIME => "Timer expired",
|
|
||||||
ENOSR => "Out of streams resources",
|
|
||||||
ENONET => "Machine is not on the network",
|
|
||||||
ENOPKG => "Package not installed",
|
|
||||||
EREMOTE => "Object is remote",
|
|
||||||
ENOLINK => "Link has been severed",
|
|
||||||
EADV => "Advertise error",
|
|
||||||
ESRMNT => "Srmount error",
|
|
||||||
ECOMM => "Communication error on send",
|
|
||||||
EPROTO => "Protocol error",
|
|
||||||
EMULTIHOP => "Multihop attempted",
|
|
||||||
EDOTDOT => "RFS specific error",
|
|
||||||
EBADMSG => "Bad message",
|
|
||||||
EOVERFLOW => "Value too large for defined data type",
|
|
||||||
ENOTUNIQ => "Name not unique on network",
|
|
||||||
EBADFD => "File descriptor in bad state",
|
|
||||||
EREMCHG => "Remote address changed",
|
|
||||||
ELIBACC => "Can not access a needed shared library",
|
|
||||||
ELIBBAD => "Accessing a corrupted shared library",
|
|
||||||
ELIBSCN => ".lib section in a.out corrupted",
|
|
||||||
ELIBMAX => "Attempting to link in too many shared libraries",
|
|
||||||
ELIBEXEC => "Cannot exec a shared library directly",
|
|
||||||
EILSEQ => "Invalid or incomplete multibyte or wide character",
|
|
||||||
ERESTART => "Interrupted system call should be restarted",
|
|
||||||
ESTRPIPE => "Streams pipe error",
|
|
||||||
EUSERS => "Too many users",
|
|
||||||
ENOTSOCK => "Socket operation on non-socket",
|
|
||||||
EDESTADDRREQ => "Destination address required",
|
|
||||||
EMSGSIZE => "Message too long",
|
|
||||||
EPROTOTYPE => "Protocol wrong type for socket",
|
|
||||||
ENOPROTOOPT => "Protocol not available",
|
|
||||||
EPROTONOSUPPORT => "Protocol not supported",
|
|
||||||
ESOCKTNOSUPPORT => "Socket type not supported",
|
|
||||||
ENOTSUP => "Operation not supported",
|
|
||||||
EPFNOSUPPORT => "Protocol family not supported",
|
|
||||||
EAFNOSUPPORT => "Address family not supported by protocol",
|
|
||||||
EADDRINUSE => "Address already in use",
|
|
||||||
EADDRNOTAVAIL => "Cannot assign requested address",
|
|
||||||
ENETDOWN => "Network is down",
|
|
||||||
ENETUNREACH => "Network is unreachable",
|
|
||||||
ENETRESET => "Network dropped connection on reset",
|
|
||||||
ECONNABORTED => "Software caused connection abort",
|
|
||||||
ECONNRESET => "Connection reset by peer",
|
|
||||||
ENOBUFS => "No buffer space available",
|
|
||||||
EISCONN => "Transport endpoint is already connected",
|
|
||||||
ENOTCONN => "Transport endpoint is not connected",
|
|
||||||
ESHUTDOWN => "Cannot send after transport endpoint shutdown",
|
|
||||||
ETOOMANYREFS => "Too many references: cannot splice",
|
|
||||||
ETIMEDOUT => "Connection timed out",
|
|
||||||
ECONNREFUSED => "Connection refused",
|
|
||||||
EHOSTDOWN => "Host is down",
|
|
||||||
EHOSTUNREACH => "No route to host",
|
|
||||||
EALREADY => "Operation already in progress",
|
|
||||||
EINPROGRESS => "Operation now in progress",
|
|
||||||
ESTALE => "Stale file handle",
|
|
||||||
EUCLEAN => "Structure needs cleaning",
|
|
||||||
ENOTNAM => "Not a XENIX named type file",
|
|
||||||
ENAVAIL => "No XENIX semaphores available",
|
|
||||||
EISNAM => "Is a named type file",
|
|
||||||
EREMOTEIO => "Remote I/O error",
|
|
||||||
EDQUOT => "Disk quota exceeded",
|
|
||||||
ENOMEDIUM => "No medium found",
|
|
||||||
EMEDIUMTYPE => "Wrong medium type",
|
|
||||||
ECANCELED => "Operation canceled",
|
|
||||||
ENOKEY => "Required key not available",
|
|
||||||
EKEYEXPIRED => "Key has expired",
|
|
||||||
EKEYREVOKED => "Key has been revoked",
|
|
||||||
EKEYREJECTED => "Key was rejected by service",
|
|
||||||
EOWNERDEAD => "Owner died",
|
|
||||||
ENOTRECOVERABLE => "State not recoverable",
|
|
||||||
ERFKILL => "Operation not possible due to RF-kill",
|
|
||||||
EHWPOISON => "Memory page has hardware error",
|
|
||||||
EEOF => "Unexpected EOF",
|
|
||||||
EINVALDAT => "Invalid data",
|
|
||||||
EWRZERO => "Write zero",
|
|
||||||
}
|
|
||||||
.to_string()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn getcwd() -> io::Result<PathBuf> {
|
pub fn getcwd() -> io::Result<PathBuf> {
|
||||||
|
@ -46,7 +46,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
|||||||
//}
|
//}
|
||||||
//Ok(buf.len())
|
//Ok(buf.len())
|
||||||
let Some(fd) = *STDOUT_FD.get().unwrap() else {
|
let Some(fd) = *STDOUT_FD.get().unwrap() else {
|
||||||
return Ok(buf.len());
|
return Ok(0);
|
||||||
};
|
};
|
||||||
let file = File { fs_pid: fd.0, fd: fd.1 };
|
let file = File { fs_pid: fd.0, fd: fd.1 };
|
||||||
let res = file.write(buf);
|
let res = file.write(buf);
|
||||||
@ -74,7 +74,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
|||||||
//}
|
//}
|
||||||
//Ok(buf.len())
|
//Ok(buf.len())
|
||||||
let Some(fd) = *STDERR_FD.get().unwrap() else {
|
let Some(fd) = *STDERR_FD.get().unwrap() else {
|
||||||
return Ok(buf.len());
|
return Ok(0);
|
||||||
};
|
};
|
||||||
let file = File { fs_pid: fd.0, fd: fd.1 };
|
let file = File { fs_pid: fd.0, fd: fd.1 };
|
||||||
let res = file.write(buf);
|
let res = file.write(buf);
|
||||||
|
@ -194,7 +194,3 @@ pub fn irq_register(irq: u8) -> Result<(), ()> {
|
|||||||
pub fn wake_new(pid: u64) -> Result<(), ()> {
|
pub fn wake_new(pid: u64) -> Result<(), ()> {
|
||||||
if syscall1(24, pid) == 0 { Ok(()) } else { Err(()) }
|
if syscall1(24, pid) == 0 { Ok(()) } else { Err(()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clear_exited(pid: u64) -> Result<(), ()> {
|
|
||||||
if syscall1(25, pid) == 0 { Ok(()) } else { Err(()) }
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user