Path: utzoo!utgpu!cunews!cognos!jimp From: jimp@cognos.UUCP (Jim Patterson) Newsgroups: comp.sys.hp Subject: Re: bcopy v.s. memcpy (was BSD and HPUX, The Questions Continue...) Summary: Use memmove Message-ID: <9674@cognos.UUCP> Date: 25 May 91 20:22:20 GMT References: <1991May2.202710.5152@odin.diku.dk> <5570626@hpfcdc.HP.COM> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 20 In article jbw@bigbird.bu.edu (Joe Wells) writes: +>tml@tik.vtt.fi (Tor Lillqvist) writes: +> (using the b* and index functions even if ANSI C and POSIX mandate +> mem* and strchr)? >bcopy guarantees correct overlapping moves. memcpy does not. When ANSI C >or POSIX provide us with a function that is guaranteed to handle >overlapping moves correctly, then you can justify your position. They have. memmove is part of the ANSI C standard, and guarantees proper handling of overlapping moves. I believe that it's part of POSIX as well, since POSIX requires ANSI C. -- Jim Patterson Cognos Incorporated UUNET:uunet!cognos.uucp!jimp P.O. BOX 9707 BITNET:ccs.carleton.ca!cognos.uucp!jimp 3755 Riverside Drive PHONE:(613)738-1440 x6112 Ottawa, Ont K1G 3Z4