Compare commits

..

4 Commits

5 changed files with 420 additions and 138 deletions

View File

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

View File

@ -41,3 +41,8 @@ pub fn irq_register(irq: u8) -> Result<(), ()> {
pub fn wake_new(pid: u64) -> Result<(), ()> {
syscalls::wake_new(pid)
}
#[stable(feature = "mikros", since = "1.80.0")]
pub fn clear_exited(pid: u64) -> Result<(), ()> {
syscalls::clear_exited(pid)
}

View File

@ -12,7 +12,145 @@ pub fn errno() -> Errno {
}
pub fn error_string(errno: Errno) -> String {
errno.to_string()
use Errno::*;
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> {

View File

@ -46,7 +46,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
//}
//Ok(buf.len())
let Some(fd) = *STDOUT_FD.get().unwrap() else {
return Ok(0);
return Ok(buf.len());
};
let file = File { fs_pid: fd.0, fd: fd.1 };
let res = file.write(buf);
@ -74,7 +74,7 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
//}
//Ok(buf.len())
let Some(fd) = *STDERR_FD.get().unwrap() else {
return Ok(0);
return Ok(buf.len());
};
let file = File { fs_pid: fd.0, fd: fd.1 };
let res = file.write(buf);

View File

@ -194,3 +194,7 @@ pub fn irq_register(irq: u8) -> Result<(), ()> {
pub fn wake_new(pid: u64) -> Result<(), ()> {
if syscall1(24, pid) == 0 { Ok(()) } else { Err(()) }
}
pub fn clear_exited(pid: u64) -> Result<(), ()> {
if syscall1(25, pid) == 0 { Ok(()) } else { Err(()) }
}