1 ENDIAN.H(3HEAD) Headers ENDIAN.H(3HEAD) 2 3 NAME 4 endian.h - definitions for endian routines 5 6 SYNOPSIS 7 #include <endian.h> 8 9 DESCRIPTION 10 The <endian.h> header defines functions and macros focused on converting 11 data between the host machines native byte order and big or little-endian 12 values. While the manual page details the macros defined by <endian.h>, 13 the functions are documented separately in endian(3C). More information 14 on endianness and a general background on the topic can be found in 15 byteorder(5). 16 17 The <endian.h> header defines the following macros: 18 19 LITTLE_ENDIAN 20 A constant used to indicate a little-endian integer. It is 21 always defined, regardless of the actual endianess of the 22 underlying platform. This macro should be used to compare 23 against the BYTE_ORDER macro. 24 25 BIG_ENDIAN 26 A constant used to indicate a big-endian integer. It is always 27 defined, regardless of the actual endianess of the underlying 28 platform. This macro should be used to compare against the 29 BYTE_ORDER macro. 30 31 PDP_ENDIAN 32 A constant used to indicate the endianness used for four byte 33 values on the PDP-11. It is always defined, regardless of the 34 actual endianess of the underlying platform. This macro should 35 be used to compare against the BYTE_ORDER macro. 36 37 BYTE_ORDER 38 The value of the BYTE_ORDER macro will be one of LITTLE_ENDIAN or 39 BIG_ENDIAN. At this time, no supported architectures use the 40 byte order indicated by the PDP_ENDIAN macro. 41 42 To determine the byte order of a system, one may compare the 43 BYTE_ORDER to one of the aforementioned macros. 44 45 In addition to the routines provided by this header, standardized 46 functions may be found in byteorder(3C). The header types.h(3HEAD) also 47 defines additional pre-processor symbols to determine the current 48 endianness of the system. 49 50 INTERFACE STABILITY 51 Committed 52 53 SEE ALSO 54 byteorder(3C), endian(3C), types.h(3HEAD), attributes(5), byteorder(5) 55 56 illumos August 2, 2018 illumos