Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 May 2011 19:50:04 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@FreeBSD.org>, mdf@FreeBSD.org, "svn-src-all@freebsd.org" <svn-src-all@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, Hans Petter Selasky <hselasky@c2i.net>
Subject:   Re: svn commit: r221604 - head/usr.sbin/usbdump
Message-ID:  <20110508194150.R981@besplex.bde.org>
In-Reply-To: <BANLkTikoE3D7xDzJ-Z0izX_2SzeOtq9U2g@mail.gmail.com>
References:  <201105071628.p47GSO16006145@svn.freebsd.org> <201105071836.00660.hselasky@c2i.net> <BANLkTimi_Em60n9MZRTcgBDvycqH-pKL5g@mail.gmail.com> <BANLkTikoE3D7xDzJ-Z0izX_2SzeOtq9U2g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1604857336-1304848204=:981
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Sat, 7 May 2011, Garrett Cooper wrote:

> On Sat, May 7, 2011 at 10:13 AM,  <mdf@freebsd.org> wrote:
>> On Sat, May 7, 2011 at 9:36 AM, Hans Petter Selasky <hselasky@c2i.net> w=
rote:
>>> On Saturday 07 May 2011 18:28:24 Hans Petter Selasky wrote:
>>>> =A0 - Use memcpy() instead of bcopy().
>>>
>>> - Use memset() instead of bzero().
>>
>> Why? =A0It usually falls through to the same code in libc. =A0Is there
>> some standardization on memfoo versus bfoo here?

As part of adding lots of style bugs I suppose.

>    bfoo is marked legacy per POSIX 2001.1; example:
> http://pubs.opengroup.org/onlinepubs/009695399/functions/bcopy.html .

bfoo was correctly left out of POSIX.1-1988.  However, POSIX.1-2001 brought
back lots of historical cruft 13 years after POSIX.1-1988 deprecated it by
not having it at all.  However2, the bcopy family is not historical cruft
in BSD.

> A lot of folks (Linux leading the charge) are actively working to
> deprecate the APIs.

Another reason to not deprecate it in BSD :-).

bzero() is technically better than memset() since it doesn't waste
space or time for an extra arg.  bcmp() is technically better than
memcmp() for the usual case where you only want a binary result.  The
other bcopy functions are just different spellings of the newer
interfaces.

Bruce
--0-1604857336-1304848204=:981--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110508194150.R981>