From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:50:17 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFABF106566B; Sun, 8 May 2011 09:50:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 79BBE8FC08; Sun, 8 May 2011 09:50:17 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p489o442008739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 19:50:06 +1000 Date: Sun, 8 May 2011 19:50:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20110508194150.R981@besplex.bde.org> References: <201105071628.p47GSO16006145@svn.freebsd.org> <201105071836.00660.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1604857336-1304848204=:981" Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r221604 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:50:18 -0000 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, wrote: >> On Sat, May 7, 2011 at 9:36 AM, Hans Petter Selasky 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--