NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <mem/chMem.h>int rgnDup(KnCap *tgtactorcap, KnCap *srcactorcap, VmFlags flags);
MEM_VIRTUAL
The rgnDup function duplicates regions from the address space specified by srcactorcap into the actor address space specified by tgtactorcap. If srcactorcap and/or tgtactorcap is K_MYACTOR, the address space of the current actor is used as the source and/or the destination, respectively.
For each region from the source actor rgnDup duplicates the region in the target actor address space with the same address, the same size and the same attributes (options).
The duplicate region can either share the data with the source region (map to the same segment of volatile memory as the source), or take a private volatile copy. The data is shared if the flags argument is K_INHERITSHARE or if flags is zero and the source region has the K_INHERITSHARE attribute. The data is copied if the flags argument is K_INHERITCOPY or if flags is zero and the source region has the K_INHERITCOPY attribute.
The region isn't duplicated if the flag argument is zero and the region has enither the K_INHERITSHARE nor the K_INHERITCOPY attribute.
Before the operation, the target actor address space must be empty.
If successful K_OK is returned, otherwise a negative error code is returned.
Some of the provided arguments are outside the caller's address space.
An inconsistent actor capability.
tgtactorcap or srcactorcap does not specify a reachable actor.
The target actor address space is not empty.
The system is out of resources.
The segment mapper doesn't respect the kernel/mapper protocol.
The target actor, the source actor and the current actor must be located on the same site.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO