Link Search Menu Expand Document

read_mbx_421

long read_mbx_421(const char __user *name, unsigned char __user *data, unsigned long offset, unsigned long n);

Description

Copies up to n bytes to data, starting at offset bytes into the mailbox

Parameters

  • name: Same as create_mbx. Must refer to an existing mailbox
  • data: A user-space pointer to data to write from the mailbox
  • offset: How many bytes into the mailbox’s memory the data will be read from
  • n: The length of data, and how many bytes the user is requesting

Return

Returns the number of bytes successfully copied (which should be the minimum of the shared memory size minus the provided offset and n). Otherwise the function must return an appropriate error code as discussed in the system description.