enum mach_msg_return_t [src]
Alias for std.c.darwin.mach_msg_return_t
Mach msg return values
Fields
SUCCESS = 0x00000000
SEND_IN_PROGRESS = 0x10000001Thread is waiting to send. (Internal use only.)
SEND_INVALID_DATA = 0x10000002Bogus in-line data.
SEND_INVALID_DEST = 0x10000003Bogus destination port.
SEND_TIMED_OUT = 0x10000004Message not sent before timeout expired.
SEND_INVALID_VOUCHER = 0x10000005Bogus voucher port.
SEND_INTERRUPTED = 0x10000007Software interrupt.
SEND_MSG_TOO_SMALL = 0x10000008Data doesn't contain a complete message.
SEND_INVALID_REPLY = 0x10000009Bogus reply port.
SEND_INVALID_RIGHT = 0x1000000aBogus port rights in the message body.
SEND_INVALID_NOTIFY = 0x1000000bBogus notify port argument.
SEND_INVALID_MEMORY = 0x1000000cInvalid out-of-line memory pointer.
SEND_NO_BUFFER = 0x1000000dNo message buffer is available.
SEND_TOO_LARGE = 0x1000000eSend is too large for port
SEND_INVALID_TYPE = 0x1000000fInvalid msg-type specification.
SEND_INVALID_HEADER = 0x10000010A field in the header had a bad value.
SEND_INVALID_TRAILER = 0x10000011The trailer to be sent does not match kernel format.
SEND_INVALID_CONTEXT = 0x10000012The sending thread context did not match the context on the dest port
SEND_INVALID_RT_OOL_SIZE = 0x10000015compatibility: no longer a returned error
SEND_NO_GRANT_DEST = 0x10000016The destination port doesn't accept ports in body
SEND_MSG_FILTERED = 0x10000017Message send was rejected by message filter
RCV_IN_PROGRESS = 0x10004001Thread is waiting for receive. (Internal use only.)
RCV_INVALID_NAME = 0x10004002Bogus name for receive port/port-set.
RCV_TIMED_OUT = 0x10004003Didn't get a message within the timeout value.
RCV_TOO_LARGE = 0x10004004Message buffer is not large enough for inline data.
RCV_INTERRUPTED = 0x10004005Software interrupt.
RCV_PORT_CHANGED = 0x10004006compatibility: no longer a returned error
RCV_INVALID_NOTIFY = 0x10004007Bogus notify port argument.
RCV_INVALID_DATA = 0x10004008Bogus message buffer for inline data.
RCV_PORT_DIED = 0x10004009Port/set was sent away/died during receive.
RCV_IN_SET = 0x1000400acompatibility: no longer a returned error
RCV_HEADER_ERROR = 0x1000400bError receiving message header. See special bits (use extractResourceError).
RCV_BODY_ERROR = 0x1000400cError receiving message body. See special bits (use extractResourceError).
RCV_INVALID_TYPE = 0x1000400dInvalid msg-type specification in scatter list.
RCV_SCATTER_SMALL = 0x1000400eOut-of-line overwrite region is not large enough
RCV_INVALID_TRAILER = 0x1000400ftrailer type or number of trailer elements not supported
RCV_IN_PROGRESS_TIMED = 0x10004011Waiting for receive with timeout. (Internal use only.)
RCV_INVALID_REPLY = 0x10004012invalid reply port used in a STRICT_REPLY message
_
Members
- extractResourceError (Type Function)
Source
pub const mach_msg_return_t = enum(kern_return_t) {
SUCCESS = 0x00000000,
/// Thread is waiting to send. (Internal use only.)
SEND_IN_PROGRESS = 0x10000001,
/// Bogus in-line data.
SEND_INVALID_DATA = 0x10000002,
/// Bogus destination port.
SEND_INVALID_DEST = 0x10000003,
/// Message not sent before timeout expired.
SEND_TIMED_OUT = 0x10000004,
/// Bogus voucher port.
SEND_INVALID_VOUCHER = 0x10000005,
/// Software interrupt.
SEND_INTERRUPTED = 0x10000007,
/// Data doesn't contain a complete message.
SEND_MSG_TOO_SMALL = 0x10000008,
/// Bogus reply port.
SEND_INVALID_REPLY = 0x10000009,
/// Bogus port rights in the message body.
SEND_INVALID_RIGHT = 0x1000000a,
/// Bogus notify port argument.
SEND_INVALID_NOTIFY = 0x1000000b,
/// Invalid out-of-line memory pointer.
SEND_INVALID_MEMORY = 0x1000000c,
/// No message buffer is available.
SEND_NO_BUFFER = 0x1000000d,
/// Send is too large for port
SEND_TOO_LARGE = 0x1000000e,
/// Invalid msg-type specification.
SEND_INVALID_TYPE = 0x1000000f,
/// A field in the header had a bad value.
SEND_INVALID_HEADER = 0x10000010,
/// The trailer to be sent does not match kernel format.
SEND_INVALID_TRAILER = 0x10000011,
/// The sending thread context did not match the context on the dest port
SEND_INVALID_CONTEXT = 0x10000012,
/// compatibility: no longer a returned error
SEND_INVALID_RT_OOL_SIZE = 0x10000015,
/// The destination port doesn't accept ports in body
SEND_NO_GRANT_DEST = 0x10000016,
/// Message send was rejected by message filter
SEND_MSG_FILTERED = 0x10000017,
/// Thread is waiting for receive. (Internal use only.)
RCV_IN_PROGRESS = 0x10004001,
/// Bogus name for receive port/port-set.
RCV_INVALID_NAME = 0x10004002,
/// Didn't get a message within the timeout value.
RCV_TIMED_OUT = 0x10004003,
/// Message buffer is not large enough for inline data.
RCV_TOO_LARGE = 0x10004004,
/// Software interrupt.
RCV_INTERRUPTED = 0x10004005,
/// compatibility: no longer a returned error
RCV_PORT_CHANGED = 0x10004006,
/// Bogus notify port argument.
RCV_INVALID_NOTIFY = 0x10004007,
/// Bogus message buffer for inline data.
RCV_INVALID_DATA = 0x10004008,
/// Port/set was sent away/died during receive.
RCV_PORT_DIED = 0x10004009,
/// compatibility: no longer a returned error
RCV_IN_SET = 0x1000400a,
/// Error receiving message header. See special bits (use `extractResourceError`).
RCV_HEADER_ERROR = 0x1000400b,
/// Error receiving message body. See special bits (use `extractResourceError`).
RCV_BODY_ERROR = 0x1000400c,
/// Invalid msg-type specification in scatter list.
RCV_INVALID_TYPE = 0x1000400d,
/// Out-of-line overwrite region is not large enough
RCV_SCATTER_SMALL = 0x1000400e,
/// trailer type or number of trailer elements not supported
RCV_INVALID_TRAILER = 0x1000400f,
/// Waiting for receive with timeout. (Internal use only.)
RCV_IN_PROGRESS_TIMED = 0x10004011,
/// invalid reply port used in a STRICT_REPLY message
RCV_INVALID_REPLY = 0x10004012,
_,
pub fn extractResourceError(ret: mach_msg_return_t) struct {
error_code: mach_msg_return_t,
resource_error: ?MACH.MSG,
} {
const return_code: mach_msg_return_t = @enumFromInt(@intFromEnum(ret) & ~MACH.MSG.MASK);
switch (return_code) {
.RCV_HEADER_ERROR, .RCV_BODY_ERROR => {
const resource_error: MACH.MSG = @bitCast(@intFromEnum(ret) & MACH.MSG.MASK);
return .{
.error_code = return_code,
.resource_error = resource_error,
};
},
else => return .{
.error_code = ret,
.resource_error = null,
},
}
}
}