>I am using SUN-OS 4.1, and do not see major differences between
>memcpy and bcopy. The only one is that memcpy is likely not to
>behave in case of overlapping between arg1 and arg2.
Likewise for some implementations of bcopy(). It's never been entirely clear
whether it was supposed to implement memcpy() or memmove().
My recommendation: use memcpy() for non-overlapping moves, memmove() for
overlapping moves, and never use bcopy().
If you're porting a program that currently uses bcopy(), examine it to
determine whether the arguments could overlap or not; if you aren't sure, then
use memmove() to be safe, and ADD A COMMENT so your successor (or your future
self) will know that you weren't sure.
If you're using a backwards implementation that doesn't supply memcpy() and/or
memmove(), use them anyway -- and implement them yourself with a compatibility
library. (But CONDITIONALLY. Don't define them on systems where they already
exist!) They are both short functions. (You could even implement one or both
with calls to bcopy(), if that function exists and (for memmove) is known to
handle overlapping moves correctly, but I would normally just code the loop.)
Both memcpy() and memmove() are standard functions in ANSI C, and hence in
POSIX. bcopy() has BSD and V7 ancestry, while memcpy() comes from the USG
line. memmove() is a relatively recent addition; I believe it was proposed by
Rob Pike and may have appeared in V8.