The PUTM system call wirtes into the given memory object data from the block of memory attached to the current process, starting at virtual address addr and with length len. The number of actually written data bytes is returned as the result code. The passive access to the memory object is removed from top of the stack.
The PUTM system call is not a part of the basic set of system calls, it is provided only for efficiency. PUTM is equivalent to the following code using the MEMR system call:
The access to memory object must allow requests with codes MEM_WRITE 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 PUTM returns the actual number of bytes copied from the attached memory into the memory object. The returned length cannot be larger than len.
If stack is empty PUTM returns error code ERR_EMPTY_STACK.
If address or length of the memory block are not valid PUTM returns error code ERR_INVALID_ADDRESS.
If attached memory segment at the specified address is write-only PUTM returns error code ERR_NO_PERMISSIONS.
If access to the memory object does not allow request code MEM_READ PUTM returns error code ERR_ARG_PERMS.
If access on top of stack points to an object with type incompatible with memory protocol PUTM returns error code ERR_ARG_TYPE.
If access on top of stack has expired PUTM returns error code ERR_ARG_EXPIRED.
If there is no sufficient kernel memory for the temporary memory object and/or transaction PUTM returns error code ERR_NO_KERNEL_MEMORY.