diff options
Diffstat (limited to 'man3/endian.3')
-rw-r--r-- | man3/endian.3 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/man3/endian.3 b/man3/endian.3 index 6e572390d..fa7b9fd80 100644 --- a/man3/endian.3 +++ b/man3/endian.3 @@ -5,7 +5,7 @@ .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.TH endian 3 2023-01-07 "Linux man-pages 6.03" +.TH endian 3 2023-05-03 "Linux man-pages 6.05.01" .SH NAME htobe16, htole16, be16toh, le16toh, htobe32, htole32, be32toh, le32toh, htobe64, htole64, be64toh, le64toh \- @@ -80,9 +80,6 @@ from big-endian order to host byte order. The functions with names of the form "le\fInn\fPtoh" convert from little-endian order to host byte order. .SH VERSIONS -These functions were added in glibc 2.9. -.SH STANDARDS -These functions are nonstandard. Similar functions are present on the BSDs, where the required header file is .I <sys/endian.h> @@ -96,7 +93,11 @@ whereby the component always appears at the end of the function name (thus, for example, in NetBSD, FreeBSD, and glibc, the equivalent of OpenBSDs "betoh32" is "be32toh"). -.SH NOTES +.SH STANDARDS +None. +.SH HISTORY +glibc 2.9. +.PP These functions are similar to the older .BR byteorder (3) family of functions. @@ -136,7 +137,7 @@ htobe32(x.u32) = 0x11223344 #include <stdint.h> #include <stdio.h> #include <stdlib.h> - +\& int main(void) { @@ -144,16 +145,16 @@ main(void) uint32_t u32; uint8_t arr[4]; } x; - +\& x.arr[0] = 0x11; /* Lowest\-address byte */ x.arr[1] = 0x22; x.arr[2] = 0x33; x.arr[3] = 0x44; /* Highest\-address byte */ - +\& printf("x.u32 = %#x\en", x.u32); printf("htole32(x.u32) = %#x\en", htole32(x.u32)); printf("htobe32(x.u32) = %#x\en", htobe32(x.u32)); - +\& exit(EXIT_SUCCESS); } .EE |