Subject: Re: copystr
To: David Laight <david@l8s.co.uk>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: tech-kern
Date: 09/03/2002 12:12:52
David Laight wrote:
> > actually, doesn't kernel bcopy() not work for overlapping
> > regions of memory, by design? they are not exactly the same.
>
> FWIW memmove() check for overlapped copies and memcpy()
> should not (and would be expected to copy 'forwards').
Yes, this is exactly how our kernel and userland memcpy() and memmove()
work.
There used to be difference between kernel bcopy() and userland
bcopy(), in that userland bcopy() did check and handled overlapping
regions, but kernel bcopy() did not (for performance reasons).
There used to be ovbcopy() in kernel, which did handled overlapping
regions, but it was removed altogether in favour of memmove().
Jaromir
--
Jaromir Dolecek <jdolecek@NetBSD.org> http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-