*BSD News Article 38718


Return to BSD News archive

Xref: sserve comp.unix.bsd:15409 comp.lang.c:86708 comp.unix.sys5.r3:2295
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!werple.apana.org.au!daemon.apana.org.au!udel!gatech!howland.reston.ans.net!news.sprintlink.net!redstone.interpath.net!ddsw1!news.cic.net!locust.cic.net!pauls
From: pauls@locust.cic.net (Paul Southworth)
Newsgroups: comp.unix.bsd,comp.lang.c,comp.unix.sys5.r3
Subject: how to completely get rid of bcopy, bzero, bcmp?
Followup-To: poster
Date: 1 Dec 1994 16:17:32 GMT
Organization: CICNet, Inc.
Lines: 31
Message-ID: <3bksus$fg4@spruce.cic.net>
NNTP-Posting-Host: locust.cic.net

I'm not much of a System V user, and I've always been lazy and fooled
with compatibility libs on most SVR[34] machines (I know I know, for
shame) to get bzero, bcopy and bcmp functionality.  Anyway, now I have
to build BSD telnetd for a Sequent running DYNIX/ptx 2.1.0 and lo, it's
just SVR3(?) no compatibility anything.  So anyway, for example, we
have a bcopy in slc.c:

                /*
                 * save this slc buffer if it is the first, otherwise dump
                 * it.
                 */
                if (def_slcbuf == (unsigned char *)0) {
                        def_slclen = len;
                        def_slcbuf = (unsigned char *)malloc((unsigned)len);
                        if (def_slcbuf == (unsigned char *)0)
                                return;  /* too bad */
                        bcopy(ptr, def_slcbuf, len);
                }

What should that bcopy() look like to make this SVR3 system happy?

Is there a "right" way to implement bcopy() etc on this system so I could
generate my own compatibility library and not bother with altering the
code every time?

Working with gcc 2.6.2 if it matters.

--
Paul Southworth
CICNet Systems Support
pauls@cic.net