public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* why use memcpy when memmove is there?
@ 2007-08-13 10:55 sk malik
  2007-08-13 14:15 ` Jan Engelhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: sk malik @ 2007-08-13 10:55 UTC (permalink / raw)
  To: linux-kernel

Hi, All

We were looking at  "[kernel]/lib/string.c"
(http://lxr.linux.no/source/lib/string.c#L500)

memcpy copies a part of memory to some other location
but It will not work for all cases of overlapping
blocks.(if the start of destination block falls
between the source block)

while memove copes with overlapping areas.

then why is memcpy present in the sources can't we
simply do

"#define memcpy memmove" in include/linux/string.h

or am I missing something?

Regards
Sri



      Unlimited freedom, unlimited storage. Get it now, on http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-14 22:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.tH0XPZg4jvmqSQh3iOmzbwrRN9Y@ifi.uio.no>
2007-08-13 14:33 ` why use memcpy when memmove is there? Robert Hancock
2007-08-13 10:55 sk malik
2007-08-13 14:15 ` Jan Engelhardt
2007-08-13 15:02 ` Stefan Richter
2007-08-14 21:59 ` David Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox