public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: sk malik <srikrishanmalik@yahoo.co.in>
To: linux-kernel@vger.kernel.org
Subject: why use memcpy when memmove is there?
Date: Mon, 13 Aug 2007 11:55:40 +0100 (BST)	[thread overview]
Message-ID: <977159.24669.qm@web7606.mail.in.yahoo.com> (raw)

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/

             reply	other threads:[~2007-08-13 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-13 10:55 sk malik [this message]
2007-08-13 14:15 ` why use memcpy when memmove is there? Jan Engelhardt
2007-08-13 15:02 ` Stefan Richter
2007-08-14 21:59 ` David Schwartz
     [not found] <fa.tH0XPZg4jvmqSQh3iOmzbwrRN9Y@ifi.uio.no>
2007-08-13 14:33 ` Robert Hancock

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=977159.24669.qm@web7606.mail.in.yahoo.com \
    --to=srikrishanmalik@yahoo.co.in \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox