Re: [PATCH] MAN: Clarify mremap.2 prototype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 3, 2010 at 11:08 AM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> MAN: Clarify mremap.2 prototype
>
> mremap sometimes accepts more arguments and sometimes less.
> Clarify this in the prototype and initial description in the manpage.
>
> Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> ---
>  man2/mremap.2 |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> Index: man-pages-3.24/man2/mremap.2
> ===================================================================
> --- man-pages-3.24.orig/man2/mremap.2
> +++ man-pages-3.24/man2/mremap.2
> @@ -39,6 +39,9 @@ mremap \- remap a virtual memory address
>  .sp
>  .BI "void *mremap(void *" old_address ", size_t " old_size ,
>  .BI "             size_t " new_size ", int " flags );
> +.sp
> +.BI "void *mremap(void *" old_address ", size_t " old_size ,
> +.BI "             size_t " new_size ", int " flags ", void *" new_address );
>  .fi
>  .SH DESCRIPTION
>  .BR mremap ()
> @@ -54,6 +57,11 @@ aligned.
>  virtual memory block.
>  \fInew_size\fP is the requested size of the
>  virtual memory block after the resize.
> +\fInew_address\fP is the new address to move the block to. Only valid when
> +.I MREMAP_FIXED
> +and
> +.I MREMAP_MAYMOVE
> +are specified. The function is declared in a way that this argument can be omitted.
>
>  In Linux the memory is divided into pages.
>  A user process has (one or)
>

Hi Andi,

Thanks for the patch. I agree that mremap() could be improved
somewhat. But note that new_size was already described in the page. I
applied the following simpler patch.

The change will be in man-pages-3.25.

Cheers,

Michael

diff --git a/man2/mremap.2 b/man2/mremap.2
index f9d4068..c12ccb2 100644
--- a/man2/mremap.2
+++ b/man2/mremap.2
@@ -38,7 +38,7 @@ mremap \- remap a virtual memory address
 .B #include <sys/mman.h>
 .sp
 .BI "void *mremap(void *" old_address ", size_t " old_size ,
-.BI "             size_t " new_size ", int " flags );
+.BI "             size_t " new_size ", int " flags ", ...);"
 .fi
 .SH DESCRIPTION
 .BR mremap ()
@@ -54,6 +54,11 @@ aligned.
 virtual memory block.
 \fInew_size\fP is the requested size of the
 virtual memory block after the resize.
+An optional fifth argument,
+.IR new_size ,
+may be provided; see the description of
+.B MREMAP_FIXED
+below.

 In Linux the memory is divided into pages.
 A user process has (one or)
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux