From 1d05a0237c93e29bee6688e15502f15388a739b2 Mon Sep 17 00:00:00 2001 From: Theodore DeRego Date: Fri, 14 Apr 2017 18:37:57 -0700 Subject: [PATCH] Update magenta error codes --- src/libstd/sys/unix/process/magenta.rs | 87 ++++++++++++++------------ 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/src/libstd/sys/unix/process/magenta.rs b/src/libstd/sys/unix/process/magenta.rs index 07f29784df6..5b5e29c0374 100644 --- a/src/libstd/sys/unix/process/magenta.rs +++ b/src/libstd/sys/unix/process/magenta.rs @@ -202,7 +202,7 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; // ERR_NO_RESOURCES: The system was not able to allocate some resource // needed for the operation. -#[allow(unused)] pub const ERR_NO_RESOURCES: mx_status_t = -5; +#[allow(unused)] pub const ERR_NO_RESOURCES: mx_status_t = -3; // ERR_NO_MEMORY: The system was not able to allocate memory needed // for the operation. @@ -210,30 +210,34 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; // ERR_CALL_FAILED: The second phase of mx_channel_call(; did not complete // successfully. -#[allow(unused)] pub const ERR_CALL_FAILED: mx_status_t = -53; +#[allow(unused)] pub const ERR_CALL_FAILED: mx_status_t = -5; + +// ERR_INTERRUPTED_RETRY: The system call was interrupted, but should be +// retried. This should not be seen outside of the VDSO. +#[allow(unused)] pub const ERR_INTERRUPTED_RETRY: mx_status_t = -6; // ======= Parameter errors ======= // ERR_INVALID_ARGS: an argument is invalid, ex. null pointer #[allow(unused)] pub const ERR_INVALID_ARGS: mx_status_t = -10; +// ERR_BAD_HANDLE: A specified handle value does not refer to a handle. +#[allow(unused)] pub const ERR_BAD_HANDLE: mx_status_t = -11; + // ERR_WRONG_TYPE: The subject of the operation is the wrong type to // perform the operation. // Example: Attempting a message_read on a thread handle. -#[allow(unused)] pub const ERR_WRONG_TYPE: mx_status_t = -54; +#[allow(unused)] pub const ERR_WRONG_TYPE: mx_status_t = -12; // ERR_BAD_SYSCALL: The specified syscall number is invalid. -#[allow(unused)] pub const ERR_BAD_SYSCALL: mx_status_t = -11; - -// ERR_BAD_HANDLE: A specified handle value does not refer to a handle. -#[allow(unused)] pub const ERR_BAD_HANDLE: mx_status_t = -12; +#[allow(unused)] pub const ERR_BAD_SYSCALL: mx_status_t = -13; // ERR_OUT_OF_RANGE: An argument is outside the valid range for this // operation. -#[allow(unused)] pub const ERR_OUT_OF_RANGE: mx_status_t = -13; +#[allow(unused)] pub const ERR_OUT_OF_RANGE: mx_status_t = -14; // ERR_BUFFER_TOO_SMALL: A caller provided buffer is too small for // this operation. -#[allow(unused)] pub const ERR_BUFFER_TOO_SMALL: mx_status_t = -14; +#[allow(unused)] pub const ERR_BUFFER_TOO_SMALL: mx_status_t = -15; // ======= Precondition or state errors ======= // ERR_BAD_STATE: operation failed because the current state of the @@ -241,37 +245,9 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; // not satisfied #[allow(unused)] pub const ERR_BAD_STATE: mx_status_t = -20; -// ERR_NOT_FOUND: The requested entity is not found. -#[allow(unused)] pub const ERR_NOT_FOUND: mx_status_t = -3; - -// ERR_ALREADY_EXISTS: An object with the specified identifier -// already exists. -// Example: Attempting to create a file when a file already exists -// with that name. -#[allow(unused)] pub const ERR_ALREADY_EXISTS: mx_status_t = -15; - -// ERR_ALREADY_BOUND: The operation failed because the named entity -// is already owned or controlled by another entity. The operation -// could succeed later if the current owner releases the entity. -#[allow(unused)] pub const ERR_ALREADY_BOUND: mx_status_t = -16; - // ERR_TIMED_OUT: The time limit for the operation elapsed before // the operation completed. -#[allow(unused)] pub const ERR_TIMED_OUT: mx_status_t = -23; - -// ERR_HANDLE_CLOSED: a handle being waited on was closed -#[allow(unused)] pub const ERR_HANDLE_CLOSED: mx_status_t = -24; - -// ERR_REMOTE_CLOSED: The operation failed because the remote end -// of the subject of the operation was closed. -#[allow(unused)] pub const ERR_REMOTE_CLOSED: mx_status_t = -25; - -// ERR_UNAVAILABLE: The subject of the operation is currently unable -// to perform the operation. -// Note: This is used when there's no direct way for the caller to -// observe when the subject will be able to perform the operation -// and should thus retry. -#[allow(unused)] pub const ERR_UNAVAILABLE: mx_status_t = -26; +#[allow(unused)] pub const ERR_TIMED_OUT: mx_status_t = -21; // ERR_SHOULD_WAIT: The operation cannot be performed currently but // potentially could succeed if the caller waits for a prerequisite @@ -281,7 +257,36 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; // messages waiting but has an open remote will return ERR_SHOULD_WAIT. // Attempting to read from a message pipe that has no messages waiting // and has a closed remote end will return ERR_REMOTE_CLOSED. -#[allow(unused)] pub const ERR_SHOULD_WAIT: mx_status_t = -27; +#[allow(unused)] pub const ERR_SHOULD_WAIT: mx_status_t = -22; + +// ERR_CANCELED: The in-progress operation (e.g. a wait) has been +// // canceled. +#[allow(unused)] pub const ERR_CANCELED: mx_status_t = -23; + +// ERR_PEER_CLOSED: The operation failed because the remote end +// of the subject of the operation was closed. +#[allow(unused)] pub const ERR_PEER_CLOSED: mx_status_t = -24; + +// ERR_NOT_FOUND: The requested entity is not found. +#[allow(unused)] pub const ERR_NOT_FOUND: mx_status_t = -25; + +// ERR_ALREADY_EXISTS: An object with the specified identifier +// already exists. +// Example: Attempting to create a file when a file already exists +// with that name. +#[allow(unused)] pub const ERR_ALREADY_EXISTS: mx_status_t = -26; + +// ERR_ALREADY_BOUND: The operation failed because the named entity +// is already owned or controlled by another entity. The operation +// could succeed later if the current owner releases the entity. +#[allow(unused)] pub const ERR_ALREADY_BOUND: mx_status_t = -27; + +// ERR_UNAVAILABLE: The subject of the operation is currently unable +// to perform the operation. +// Note: This is used when there's no direct way for the caller to +// observe when the subject will be able to perform the operation +// and should thus retry. +#[allow(unused)] pub const ERR_UNAVAILABLE: mx_status_t = -28; // ======= Permission check errors ======= // ERR_ACCESS_DENIED: The caller did not have permission to perform @@ -312,3 +317,7 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; #[allow(unused)] pub const ERR_BAD_PATH: mx_status_t = -50; #[allow(unused)] pub const ERR_NOT_DIR: mx_status_t = -51; #[allow(unused)] pub const ERR_NOT_FILE: mx_status_t = -52; +// ERR_FILE_BIG: A file exceeds a filesystem-specific size limit. +#[allow(unused)] pub const ERR_FILE_BIG: mx_status_t = -53; +// ERR_NO_SPACE: Filesystem or device space is exhausted. +#[allow(unused)] pub const ERR_NO_SPACE: mx_status_t = -54;