Link Search Menu Expand Document

mbox_read_421

long mbox_read_421(mailbox_id_t __user *id, uint8_t __user *data, uint64_t size, uint64_t offset);

Description

Copies size bytes to data, starting at offset bytes into the mailbox. If size + offset is greater than mailbox size, it must return -EFAULT.

A read of 0 is also considered invalid and must also result in an error.

If the id is the invalid id, the function must return -EINVAL.

You must implement this method yourselves

Parameters

  • id: A user-space pointer to the id of the mailbox. Must refer to an existing mailbox.
  • data: A user-space pointer to data to write from the mailbox
  • size: The length of data
  • offset: How many bytes into the mailbox’s memory the data will be read

Return

Returns the number of bytes successfully copied (which should generally be size). Otherwise the function must return an appropriate error code as discussed in the system description.