Re: bzero/bcopy on Solaris: Summary

From: Marcus J Ranum (mjr@tis.com)
Date: Thu Mar 04 1993 - 20:19:02 CST


>The solution is to use following #defines.
>#define bzero(b,n) memset(b,0,n)
>#define bcopy(b1,b2,n) memcpy(b2,b1,n)
>#define bcmp(b1,b2,n) memcmp(b1,b2,n)

        I'd always wondered about the wisdom of this. The BSD bcopy()
routines behave correctly for overlapping strings. memcpy() and its
buddies are provided with the following caveat:

> Character movement is performed differently in different
> implementations. Thus overlapping moves may yield
> surprises.

        Blind replacement of bcopy() with memcpy() is *not* replacing
bcopy() with an equivalent routine! I suggest you just FTP the source
for bcopy() from your local FTP server and use that.

mjr.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:07:33 CDT