On Tue, Jun 22, 2010 at 03:40:44PM -0300, Hudson Flavio V Mateus wrote:
> >> Is there any reson you use bcopy() not memcpy()?
> >> If not considder using memcpy() please. :)
> 
> > We couldn't care what you believe, unless you have diffs of your own
> > to submit.
> 
> I think the guy there asked if there is any difference, it was just that. I
> also don't know bcopy() and would like to know just out of curiosity (I'm
> really don't know, isn't not an irony): there's some difference between
> bcopy() and memcpy()?

In the hope of bringing *some* merit to this thread: there is, indeed,
an important difference between these functions: bcopy() is defined to
work properly for overlapping buffers (e.g. "bcopy(buf, buf + 1,
sizeof(buf) - 1)" will work as expected). memcpy() does have this
property on OpenBSD, but portable code should obviously not rely on
that. Of course, kernel code is not (meant to be) portable.

                Joachim

Reply via email to