[][src]Function sunrise_libuser::syscalls::reply_and_receive_with_user_buffer

pub fn reply_and_receive_with_user_buffer(
    buf: &mut [u8],
    handles: &[HandleRef],
    replytarget: Option<HandleRef>,
    timeout: Option<usize>
) -> Result<usize, KernelError>

Reply and Receive IPC requests on the given handles.

If ReplyTarget is not None, a reply from the cmdbuf will be sent to that session. Then it will wait until either of the passed sessions has an incoming message, is closed, a passed port has an incoming connection, or the timeout expires. If there is an incoming message, it is copied to the cmdbuf.

If ReplyTarget is None, the cmdbuf should contain a blank message. If this message has a C descriptor, the buffer it points to will be used as the pointer buffer. See switchbrew's IPC marshalling page. Note that a pointer buffer cannot be specified if ReplyTarget is not zero.

After being validated, passed handles will be enumerated in order; even if a session has been closed, if one that appears earlier in the list has an incoming message, it will take priority and a result code of 0x0 will be returned.