MREMAP(2) COMMAND REFERENCE MREMAP(2)
NAME
mremap - remap pages of memory
SYNOPSIS
#include <sys/types.h>
#include <sys/mman.h>
mremap(fromaddr, toaddr, len, prot)
caddrt fromaddr, toaddr;
uint len, prot;
DESCRIPTION
Mremap causes the process pages starting at fromaddr and
continuing for len bytes to be mapped to the address toaddr.
The parameter prot specifies the accessibility and condition
of the newly mapped pages. Accessibility is specified using
the same protection flags that were used to originally map
the region (see mmap(2)).
Condition is determined by two additional flags which may be
or'ed into prot.
M_RELEASE_ZFILL release page resources and set to "zero-fill-on-demand"
M_RELEASE_NFILL release page resources and set to "provide-on-demand"
If neither of these flags is present in prot, then the
original contents of the pages in the mapping are maintained
intact. Neither of the condition flags will have any effect
on a shared mapping. The facility provided by the condition
flags is more efficient than invoking munmap(2) to release
the resources and mmap(2) to reallocate them.
An additional condition flag may be or'ed into prot to
eliminate the need to reestablish the permissions when
moving or releasing a mapping.
M_PREVIOUS use the existing permissions
The fromaddr, toaddr, and len parameters must be multiples
of the system page size (obtained with the getpagesize(2)
call), which may be larger than the underlying hardware page
size.
DIAGNOSTICS
[EINVAL]
An address is not on a cluster boundary or len is not
positive.
[EPERM]
The area of the object to be mapped is protected against
the desired operation.
Printed 10/17/86 1
MREMAP(2) COMMAND REFERENCE MREMAP(2)
[EMCOLLIDE]
Portions of the new area are already mapped. This check
is made as if the old area were gone, so overlapping
moves work.
[EMRANGE]
An area is outside the possible user's address space or
includes part of the uarea.
RETURN VALUE
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and errno is set to
indicate the error.
SEE ALSO
fmap(2), getpagesize(2), mmap(2), mremap(2), munmap(2).
Printed 10/17/86 2
%%index%%
na:72,66;
sy:138,868;
de:1006,1686;
di:2692,292;3128,285;
rv:3413,236;
se:3649,220;
%%index%%000000000117