Xref: utzoo comp.lang.c:22251 comp.unix.questions:16557 comp.unix.wizards:18339 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c,comp.unix.questions,comp.unix.wizards Subject: Re: Bcopy, bzero and bcmp on a not-Berkeley machine Summary: memmove? Keywords: bcopy bzero bcmp berkely system_v Message-ID: <515@crdos1.crd.ge.COM> Date: 26 Sep 89 12:24:52 GMT References: <1155@radig.UUCP> <13p902Mz5aZY01@amdahl.uts.amdahl.com> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Followup-To: comp.lang.c Organization: GE Corp R&D Center Lines: 16 In article <13p902Mz5aZY01@amdahl.uts.amdahl.com>, kucharsk@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@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