Xref: utzoo comp.sources.wanted:6222 comp.unix.questions:11465 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!ukma!husc6!bu-cs!dartvax!andyb@coat.uucp From: andyb@coat.uucp (Andy Behrens) Newsgroups: comp.sources.wanted,comp.unix.questions Subject: Re: Memcpy definition wanted Message-ID: <12066@dartvax.Dartmouth.EDU> Date: 2 Feb 89 23:44:43 GMT References: <801@psc90.UUCP> Sender: news@dartvax.Dartmouth.EDU Reply-To: andyb%coat@dartmouth.edu Distribution: na Organization: Burlington Coat Factory Warehouse Lines: 36 In article <801@psc90.UUCP> netnews@psc90.UUCP writes: > I am looking for the definition for memcpy. For example, strchr in > BSD is rindex, and strrchr is rrindex. What is the term that BSD uses? This table shows the correspondences between the SYS V and the Berkeley byte-string operations. Note the parameters to bcopy: they're backwards from what you'd expect! SYS V BSD --------------------------- ------------------------- memcpy(dst,src,length) bcopy(src,dst,length) memset(dst,0,length) bzero(dst,length) memcmp(str1,str2,length)==0 bcmp(str1,str2,length)==0 There are a few small differences between the two sets of functions. - The BSD routines want "length" to be an unsigned int. - Memcpy and memset return a pointer to dst, while bcopy and bzero do not return a value. - Memcmp can be used for "greater than" and "less than" comparisons, while bcmp only tells you if two strings are identical, without telling which is greater. - Memset can be used to set bytes to a value other than zero. See the memory(3C) or bstring(3) man pages for all the details. -- Live justly, love gently, walk humbly. Andy Behrens andyb@coat.uucp internet: andyb%coat@dartmouth.edu uucp: {harvard,decvax}!dartvax!coat!andyb Burlington Coat, PO Box 729, Lebanon, N.H. 03766 (603) 448-5000