Per spec:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohl.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohs.html
Co-authored-by: Jeff Bailey <jbailey@google.com>
Differential D144506
[libc] Implement ntohl and ntohs rtenneti on Feb 21 2023, 9:59 AM. Authored by
Details
Per spec: https://pubs.opengroup.org/onlinepubs/9699919799/functions/ntohl.html Co-authored-by: Jeff Bailey <jbailey@google.com>
Diff Detail
Event Timeline
Comment Actions + Added explicit check for IS_LITTLE to do the swap. Comment Actions Hi Siva, Added a htonl(ntohl(...)) test. Did the swap based on host's endianess. PTAL.
Comment Actions Not sure what happened here, but the diff is not related to the topic of this change. |
Should this always convert to big-endian, or should it convert to the host's endianness?