From owner-freebsd-alpha Sat Sep 5 08:19:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA01240 for freebsd-alpha-outgoing; Sat, 5 Sep 1998 08:19:05 -0700 (PDT) (envelope-from owner-freebsd-alpha@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA01234 for ; Sat, 5 Sep 1998 08:19:02 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.1a/8.9.1) with ESMTP id RAA18444; Sat, 5 Sep 1998 17:17:50 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id RAA19956; Sat, 5 Sep 1998 17:17:48 +0200 (MET DST) Message-ID: <19980905171747.45786@follo.net> Date: Sat, 5 Sep 1998 17:17:47 +0200 From: Eivind Eklund To: John Birrell , shimon@simon-shapiro.org Cc: freebsd-alpha@FreeBSD.ORG Subject: Re: Help - No htonq, ntohq References: <199809042227.IAA12990@cimlogic.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199809042227.IAA12990@cimlogic.com.au>; from John Birrell on Sat, Sep 05, 1998 at 08:27:40AM +1000 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sat, Sep 05, 1998 at 08:27:40AM +1000, John Birrell wrote: > Simon Shapiro wrote: > > Can anyone suggest a clean, portable way to support binary competability on > > 64bit integers between an Alpha and IA? > > int64_t & u_int64_t > > > We have hton{l,s} but these are good only for 16 & 32 bit values. > > I think hton{l,s} should be kept strictly for _network_ code. I think Simon is working on sharing binary data between Intel and Alpha (running with shared disk). Saying 'strictly for network code' doesn't help solve the problem at all. May I suggest the introduction of hton16s(l,s) ntoh16s(l,s) hton16u(l,s) ntoh16u(l,s) hton32s(l,s) ntoh32s(l,s) hton32u(l,s) ntoh32u(l,s) hton64s(l,s) ntoh64s(l,s) hton64u(l,s) ntoh64u(l,s) as a much more clear way of handling the naming? (I placed the sign-indicator after the number of bits, to avoid confusion with htons()). This also give a clear answer to the question 'what should I use for 64-bit' :-) Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message