The GETM system call reads from the given memory object into the block of memory attached to the current process, starting at virtual address addr and with length len. The length of actually read data is returned as the result code. The passive access to the memory object is removed from top of the stack.
The GETM system call is not a part of the basic set of system calls, it is provided only for efficiency. GETM is equivalent to the following code using the MEMW system call:
The access to memory object must allow requests with codes MEM_READ and MEM_INFO and must have type matching the memory protocol. Note that it does not have to be an access to a segment of operative memory, access to any object supporting memory protocol is sufficient.
In case of successful execution GETM returns the actual number of bytes copied from the memory object into the attached memory. The returned length cannot be larger than len.
If stack is empty GETM returns error code ERR_EMPTY_STACK.
If address or length of the memory block are not valid GETM returns error code ERR_INVALID_ADDRESS.
If attached memory segment at the specified address is read-only GETM returns error code ERR_NO_PERMISSIONS.
If access to the memory object does not allow request code MEM_READ GETM returns error code ERR_ARG_PERMS.
If access on top of stack points to an object with type incompatible with memory protocol GETM returns error code ERR_ARG_TYPE.
If access on top of stack has expired GETM returns error code ERR_ARG_EXPIRED.
If there is no sufficient kernel memory for the temporary memory object and/or transaction GETM returns error code ERR_NO_KERNEL_MEMORY.