Re: bzero/bcopy on Solaris: Summary

From: Rob Healey (rhealey@rogue.digibd.com)
Date: Thu Mar 04 1993 - 18:45:50 CST


In article <munish.731258642@longwood>, munish@longwood.cs.ucf.edu (Munish Jain) writes:
|> Yesterday I posted an article about having problems with
|> using bzero/bcopy etc on Solaris as they are not defined
|> in the standard libc.a. I have got many responses to my
|> posting so far. Thanks to all of you who responded to my
|> article. The solution is to use following #defines.
|>
|>
|> #define bzero(b,n) memset(b,0,n)
|> #define bcopy(b1,b2,n) memcpy(b2,b1,n)
                                ^^^^^^ NOPE!

|> #define bcmp(b1,b2,n) memcmp(b1,b2,n)
|>

        Only use memcpy if your are GUARANTEED NEVER to have overlapping
        source/destination addresses. bcopy semantics handle overlaps
        properly, memcpy does NOT. Use memmove if you think you might
        run into situations where source and destination addresses may
        overlap.

                -Rob



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