Skip to content

Commit 1d05a02

Browse files
committed
Update magenta error codes
1 parent bbdaad0 commit 1d05a02

File tree

1 file changed

+43
-34
lines changed

1 file changed

+43
-34
lines changed

src/libstd/sys/unix/process/magenta.rs

+43-34
Original file line numberDiff line numberDiff line change
@@ -202,86 +202,91 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002;
202202

203203
// ERR_NO_RESOURCES: The system was not able to allocate some resource
204204
// needed for the operation.
205-
#[allow(unused)] pub const ERR_NO_RESOURCES: mx_status_t = -5;
205+
#[allow(unused)] pub const ERR_NO_RESOURCES: mx_status_t = -3;
206206

207207
// ERR_NO_MEMORY: The system was not able to allocate memory needed
208208
// for the operation.
209209
#[allow(unused)] pub const ERR_NO_MEMORY: mx_status_t = -4;
210210

211211
// ERR_CALL_FAILED: The second phase of mx_channel_call(; did not complete
212212
// successfully.
213-
#[allow(unused)] pub const ERR_CALL_FAILED: mx_status_t = -53;
213+
#[allow(unused)] pub const ERR_CALL_FAILED: mx_status_t = -5;
214+
215+
// ERR_INTERRUPTED_RETRY: The system call was interrupted, but should be
216+
// retried. This should not be seen outside of the VDSO.
217+
#[allow(unused)] pub const ERR_INTERRUPTED_RETRY: mx_status_t = -6;
214218

215219
// ======= Parameter errors =======
216220
// ERR_INVALID_ARGS: an argument is invalid, ex. null pointer
217221
#[allow(unused)] pub const ERR_INVALID_ARGS: mx_status_t = -10;
218222

223+
// ERR_BAD_HANDLE: A specified handle value does not refer to a handle.
224+
#[allow(unused)] pub const ERR_BAD_HANDLE: mx_status_t = -11;
225+
219226
// ERR_WRONG_TYPE: The subject of the operation is the wrong type to
220227
// perform the operation.
221228
// Example: Attempting a message_read on a thread handle.
222-
#[allow(unused)] pub const ERR_WRONG_TYPE: mx_status_t = -54;
229+
#[allow(unused)] pub const ERR_WRONG_TYPE: mx_status_t = -12;
223230

224231
// ERR_BAD_SYSCALL: The specified syscall number is invalid.
225-
#[allow(unused)] pub const ERR_BAD_SYSCALL: mx_status_t = -11;
226-
227-
// ERR_BAD_HANDLE: A specified handle value does not refer to a handle.
228-
#[allow(unused)] pub const ERR_BAD_HANDLE: mx_status_t = -12;
232+
#[allow(unused)] pub const ERR_BAD_SYSCALL: mx_status_t = -13;
229233

230234
// ERR_OUT_OF_RANGE: An argument is outside the valid range for this
231235
// operation.
232-
#[allow(unused)] pub const ERR_OUT_OF_RANGE: mx_status_t = -13;
236+
#[allow(unused)] pub const ERR_OUT_OF_RANGE: mx_status_t = -14;
233237

234238
// ERR_BUFFER_TOO_SMALL: A caller provided buffer is too small for
235239
// this operation.
236-
#[allow(unused)] pub const ERR_BUFFER_TOO_SMALL: mx_status_t = -14;
240+
#[allow(unused)] pub const ERR_BUFFER_TOO_SMALL: mx_status_t = -15;
237241

238242
// ======= Precondition or state errors =======
239243
// ERR_BAD_STATE: operation failed because the current state of the
240244
// object does not allow it, or a precondition of the operation is
241245
// not satisfied
242246
#[allow(unused)] pub const ERR_BAD_STATE: mx_status_t = -20;
243247

248+
// ERR_TIMED_OUT: The time limit for the operation elapsed before
249+
// the operation completed.
250+
#[allow(unused)] pub const ERR_TIMED_OUT: mx_status_t = -21;
251+
252+
// ERR_SHOULD_WAIT: The operation cannot be performed currently but
253+
// potentially could succeed if the caller waits for a prerequisite
254+
// to be satisfied, for example waiting for a handle to be readable
255+
// or writable.
256+
// Example: Attempting to read from a message pipe that has no
257+
// messages waiting but has an open remote will return ERR_SHOULD_WAIT.
258+
// Attempting to read from a message pipe that has no messages waiting
259+
// and has a closed remote end will return ERR_REMOTE_CLOSED.
260+
#[allow(unused)] pub const ERR_SHOULD_WAIT: mx_status_t = -22;
261+
262+
// ERR_CANCELED: The in-progress operation (e.g. a wait) has been
263+
// // canceled.
264+
#[allow(unused)] pub const ERR_CANCELED: mx_status_t = -23;
265+
266+
// ERR_PEER_CLOSED: The operation failed because the remote end
267+
// of the subject of the operation was closed.
268+
#[allow(unused)] pub const ERR_PEER_CLOSED: mx_status_t = -24;
269+
244270
// ERR_NOT_FOUND: The requested entity is not found.
245-
#[allow(unused)] pub const ERR_NOT_FOUND: mx_status_t = -3;
271+
#[allow(unused)] pub const ERR_NOT_FOUND: mx_status_t = -25;
246272

247273
// ERR_ALREADY_EXISTS: An object with the specified identifier
248274
// already exists.
249275
// Example: Attempting to create a file when a file already exists
250276
// with that name.
251-
#[allow(unused)] pub const ERR_ALREADY_EXISTS: mx_status_t = -15;
277+
#[allow(unused)] pub const ERR_ALREADY_EXISTS: mx_status_t = -26;
252278

253279
// ERR_ALREADY_BOUND: The operation failed because the named entity
254280
// is already owned or controlled by another entity. The operation
255281
// could succeed later if the current owner releases the entity.
256-
#[allow(unused)] pub const ERR_ALREADY_BOUND: mx_status_t = -16;
257-
258-
// ERR_TIMED_OUT: The time limit for the operation elapsed before
259-
// the operation completed.
260-
#[allow(unused)] pub const ERR_TIMED_OUT: mx_status_t = -23;
261-
262-
// ERR_HANDLE_CLOSED: a handle being waited on was closed
263-
#[allow(unused)] pub const ERR_HANDLE_CLOSED: mx_status_t = -24;
264-
265-
// ERR_REMOTE_CLOSED: The operation failed because the remote end
266-
// of the subject of the operation was closed.
267-
#[allow(unused)] pub const ERR_REMOTE_CLOSED: mx_status_t = -25;
282+
#[allow(unused)] pub const ERR_ALREADY_BOUND: mx_status_t = -27;
268283

269284
// ERR_UNAVAILABLE: The subject of the operation is currently unable
270285
// to perform the operation.
271286
// Note: This is used when there's no direct way for the caller to
272287
// observe when the subject will be able to perform the operation
273288
// and should thus retry.
274-
#[allow(unused)] pub const ERR_UNAVAILABLE: mx_status_t = -26;
275-
276-
// ERR_SHOULD_WAIT: The operation cannot be performed currently but
277-
// potentially could succeed if the caller waits for a prerequisite
278-
// to be satisfied, for example waiting for a handle to be readable
279-
// or writable.
280-
// Example: Attempting to read from a message pipe that has no
281-
// messages waiting but has an open remote will return ERR_SHOULD_WAIT.
282-
// Attempting to read from a message pipe that has no messages waiting
283-
// and has a closed remote end will return ERR_REMOTE_CLOSED.
284-
#[allow(unused)] pub const ERR_SHOULD_WAIT: mx_status_t = -27;
289+
#[allow(unused)] pub const ERR_UNAVAILABLE: mx_status_t = -28;
285290

286291
// ======= Permission check errors =======
287292
// ERR_ACCESS_DENIED: The caller did not have permission to perform
@@ -312,3 +317,7 @@ pub const LP_CLONE_MXIO_CWD: u32 = 0x0002;
312317
#[allow(unused)] pub const ERR_BAD_PATH: mx_status_t = -50;
313318
#[allow(unused)] pub const ERR_NOT_DIR: mx_status_t = -51;
314319
#[allow(unused)] pub const ERR_NOT_FILE: mx_status_t = -52;
320+
// ERR_FILE_BIG: A file exceeds a filesystem-specific size limit.
321+
#[allow(unused)] pub const ERR_FILE_BIG: mx_status_t = -53;
322+
// ERR_NO_SPACE: Filesystem or device space is exhausted.
323+
#[allow(unused)] pub const ERR_NO_SPACE: mx_status_t = -54;

0 commit comments

Comments
 (0)