* memmove.3 description error
@ 2008-07-23 10:58 Mark-André Hopf
[not found] ` <48870EDA.8040908-0qgFeOjsUbEdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Mark-André Hopf @ 2008-07-23 10:58 UTC (permalink / raw)
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
The memmove page in release 2.79 states that a temporary copy is used in
case the memory regions overlap. This is of course nonsense.
The memory is either copied from front to back or from back to front.
--- memmove.3.orig 2008-07-23 12:51:56.000000000 +0200
+++ memmove.3 2008-07-23 12:53:20.000000000 +0200
@@ -39,15 +39,7 @@
.BR memmove ()
function copies \fIn\fP bytes from memory area
\fIsrc\fP to memory area \fIdest\fP.
-The memory areas may overlap: copying takes place as though
-the bytes in
-.I src
-are first copied into a temporary array that does not overlap
-.I src
-or
-.IR dest ,
-and the bytes are then copied from the temporary array to
-.IR dest .
+The memory areas may overlap.
.SH "RETURN VALUE"
The
.BR memmove ()
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: memmove.3 description error
[not found] ` <48870EDA.8040908-0qgFeOjsUbEdnm+yROfE0A@public.gmane.org>
@ 2008-07-23 11:30 ` Michael Kerrisk
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk @ 2008-07-23 11:30 UTC (permalink / raw)
To: Mark-André Hopf
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w,
linux-man-u79uwXL29TY76Z2rM5mHXA
Hello Mark-André,
On Wed, Jul 23, 2008 at 12:58 PM, Mark-André Hopf <mhopf-0qgFeOjsUbEdnm+yROfE0A@public.gmane.org> wrote:
> The memmove page in release 2.79 states that a temporary copy is used in
> case the memory regions overlap. This is of course nonsense.
> The memory is either copied from front to back or from back to front.
Careful! The page says:
copying takes place *as though*...
And that is the crucial point. How exactly the copying is done
(copied from front to back or from back to front), is an
implementation detail.
Before man-pages-2.55 this page did not contain the "as though" piece.
It just said that "The memory areas may overlap." Someone (rightly)
complained that the page didn't say what the semantics were if the
areas *did* overlap, and so the current text was added. That text is
similar to what POSIX.1 says for memmove.3.
So, I'm not applying this patch, but thanks for taking the time to
make your report. (I suppose I might consider a patch that mentioned
something about the implementation details under NOTES, if you could
provide me with enough reason to do so.)
Cheers,
Michael
> --- memmove.3.orig 2008-07-23 12:51:56.000000000 +0200
> +++ memmove.3 2008-07-23 12:53:20.000000000 +0200
> @@ -39,15 +39,7 @@
> .BR memmove ()
> function copies \fIn\fP bytes from memory area
> \fIsrc\fP to memory area \fIdest\fP.
> -The memory areas may overlap: copying takes place as though
> -the bytes in
> -.I src
> -are first copied into a temporary array that does not overlap
> -.I src
> -or
> -.IR dest ,
> -and the bytes are then copied from the temporary array to
> -.IR dest .
> +The memory areas may overlap.
> .SH "RETURN VALUE"
> The
> .BR memmove ()
>
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
man-pages online: http://www.kernel.org/doc/man-pages/online_pages.html
Found a bug? http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-23 11:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 10:58 memmove.3 description error Mark-André Hopf
[not found] ` <48870EDA.8040908-0qgFeOjsUbEdnm+yROfE0A@public.gmane.org>
2008-07-23 11:30 ` Michael Kerrisk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox