From owner-freebsd-arch Mon Dec 9 9: 5:48 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B69537B401 for ; Mon, 9 Dec 2002 09:05:47 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0864D43EBE for ; Mon, 9 Dec 2002 09:05:47 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.3/8.12.3) with ESMTP id gB9H5NTO088087; Mon, 9 Dec 2002 09:05:23 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.3/8.12.3/Submit) id gB9H5NPL088086; Mon, 9 Dec 2002 09:05:23 -0800 (PST) (envelope-from rizzo) Date: Mon, 9 Dec 2002 09:05:23 -0800 From: Luigi Rizzo To: "M. Warner Losh" Cc: arch@FreeBSD.ORG Subject: Re: le??toh, etc in userland Message-ID: <20021209090523.A75689@xorpc.icir.org> References: <20021209.095032.102181079.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021209.095032.102181079.imp@bsdimp.com>; from imp@bsdimp.com on Mon, Dec 09, 2002 at 09:50:32AM -0700 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Dec 09, 2002 at 09:50:32AM -0700, M. Warner Losh wrote: > We should provide an implementation of {b,l}e{16,32}toh and > hto{b,l}e{16,32} in libc. Any objections? I have one on the names. Historical functions (htonl(), ntohs() and friend) put the operand size at the end, and this to me makes sense because the size refers to both operands. The names you propose link the size to the {b,l}e operand only. Does it mean that we have the following interfaces ? int be16toh(u_int16_t) int le16toh(u_int16_t) int be32toh(u_int32_t) int le32toh(u_int32_t) u_int16_t htobe16(int) u_int16_t htole16(int) u_int32_t htobe32(int) u_int32_t htole32(int) (i.e. the host side has the same type) ? I remember last time we discussed the issue on the kernel you said that it was too late to change, but if we don't have such APIs in userland, then we could at least use a more consistent naming scheme. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message