Subject: htonq
To: None <tech-misc@netbsd.org, tech-userlevel@netbsd.org, tech-kern@netbsd.org>
From: Julian Assange <proff@iq.org>
List: tech-kern
Date: 03/03/1999 12:30:40
I notice that there is some add-hackery going on in relation to usage
of network byte order 64 bit quantities (e.g file offsets in ufs and
nfs). Can we define a standard way (both from kernel and userland) of
moving 64 bit quantities to and from network byte order. e.g:

#ifndef WORDS_BIGENDIAN /* i.e. if (little endian) */
#define htonq(x) (((u_64)htonl((x)>>32))|(((u_64)htonl(x))<<32))
#define ntohq(x) htonq(x)
#else
#define htonq(x) ((u_64)(x))
#define ntohq(x) ((u_64)(x))
#endif

#endif /* HTONQ_H */