diff options
Diffstat (limited to 'man2/mremap.2')
-rw-r--r-- | man2/mremap.2 | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/man2/mremap.2 b/man2/mremap.2 index f2b2b98..aa635dd 100644 --- a/man2/mremap.2 +++ b/man2/mremap.2 @@ -8,7 +8,7 @@ .\" Update for Linux 1.3.87 and later .\" 2005-10-11 mtk: Added NOTES for MREMAP_FIXED; revised EINVAL text. .\" -.TH mremap 2 2023-03-30 "Linux man-pages 6.05.01" +.TH mremap 2 2024-01-16 "Linux man-pages 6.7" .SH NAME mremap \- remap a virtual memory address .SH LIBRARY @@ -18,7 +18,7 @@ Standard C library .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .B #include <sys/mman.h> -.PP +.P .BI "void *mremap(void " old_address [. old_size "], size_t " old_size , .BI " size_t " new_size ", int " flags ", ... /* void *" new_address " */);" .fi @@ -27,7 +27,7 @@ Standard C library expands (or shrinks) an existing memory mapping, potentially moving it at the same time (controlled by the \fIflags\fP argument and the available virtual address space). -.PP +.P \fIold_address\fP is the old address of the virtual memory block that you want to expand (or shrink). Note that \fIold_address\fP has to be page @@ -41,11 +41,13 @@ An optional fifth argument, may be provided; see the description of .B MREMAP_FIXED below. -.PP +.P If the value of \fIold_size\fP is zero, and \fIold_address\fP refers to -a shareable mapping (see -.BR mmap (2) -.BR MAP_SHARED ), +a shareable mapping +(see the description of +.B MAP_SHARED +in +.BR mmap (2)), then .BR mremap () will create a new mapping of the same pages. @@ -57,7 +59,7 @@ below. If a new mapping is requested via this method, then the .B MREMAP_MAYMOVE flag must also be specified. -.PP +.P The \fIflags\fP bit-mask argument may be 0, or include the following flags: .TP .B MREMAP_MAYMOVE @@ -131,7 +133,7 @@ flag may be used to atomically move a mapping while leaving the source mapped. See NOTES for some possible applications of .BR MREMAP_DONTUNMAP . -.PP +.P If the memory segment specified by .I old_address and @@ -248,7 +250,7 @@ Linux. .\" 4.2BSD had a (never actually implemented) .\" .BR mremap (2) .\" call with completely different semantics. -.\" .PP +.\" .P Prior to glibc 2.4, glibc did not expose the definition of .BR MREMAP_FIXED , and the prototype for @@ -262,7 +264,7 @@ changes the mapping between virtual addresses and memory pages. This can be used to implement a very efficient .BR realloc (3). -.PP +.P In Linux, memory is divided into pages. A process has (one or) several linear virtual memory segments. @@ -276,7 +278,7 @@ if the memory is accessed incorrectly (e.g., writing to a read-only segment). Accessing virtual memory outside of the segments will also cause a segmentation violation. -.PP +.P If .BR mremap () is used to move or expand an area locked with @@ -321,7 +323,10 @@ if was zero and the mapping referred to by .I old_address was a private mapping -.RB ( mmap "(2) " MAP_PRIVATE ), +(see the description of +.B MAP_PRIVATE +in +.BR mmap (2)), .BR mremap () created a new private mapping unrelated to the original mapping. This behavior was unintended @@ -344,7 +349,7 @@ in this scenario. .BR sbrk (2), .BR malloc (3), .BR realloc (3) -.PP +.P Your favorite text book on operating systems for more information on paged memory (e.g., \fIModern Operating Systems\fP by Andrew S.\& Tanenbaum, |