OpenSolaris

Printable Version Enter a New Search
Bug ID 5007142
Synopsis Add ntohll and htonll to sys/byteorder.h
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:header
Keywords SFO | oss-request
Sponsor
Submitter
Responsible Engineer Daniel Anderson
Reported Against s10_54
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_98
Fixed In snv_98
Release Fixed solaris_nevada(snv_98)
Related Bugs 6717509 , 6728152 , 6729208 , 6729215 , 6747587 , 6748166 , 6750027 , 6750956 , 6753574
Submit Date 3-March-2004
Last Update Date 10-September-2008
Description
Solaris offers 32 bit ntohl and htonl macros, but does not provide a 64 bit
equivalent.
 xxxxx@xxxxx.com 2004-11-05 18:25:06 GMT
Work Around
Add the following code to relivant client programs/headers:

#ifndef htonll
#ifdef _BIG_ENDIAN
#define htonll(x)   (x)
#define ntohll(x)   (x)
#else
#define htonll(x)   ((((uint64_t)htonl(x)) << 32) + htonl(x >> 32))
#define ntohll(x)   ((((uint64_t)ntohl(x)) << 32) + ntohl(x >> 32))
#endif
#endif
 xxxxx@xxxxx.com 2004-11-05 18:25:06 GMT
Comments
N/A