Bcopy, bzero and bcmp on a not-Berkeley machine

Wm E Davidsen Jr davidsen at crdos1.crd.ge.COM
Tue Sep 26 22:24:52 AEST 1989


In article <13p902Mz5aZY01 at amdahl.uts.amdahl.com>, kucharsk at uts.amdahl.com (William Kucharski) writes:

|   >	#define bcopy(fr,to,cnt) memcpy(to,fr,cnt)
|  
|   Here's where you may have problems, depending upon the use in your program.
|   The big difference between bcopy and memcpy is that bcopy is defined to
|   handle copies of overlapping ranges of memory correctly while memcpy's
|   behavior in the same situtation is implementation and/or architecture
|   dependent.

  What you want here is memmove, not memcpy.
-- 
bill davidsen	(davidsen at crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon



More information about the Comp.unix.questions mailing list