[libc] Implement ntohl and ntohs
authorRaman Tenneti <rtenneti@google.com>
Wed, 22 Feb 2023 18:32:09 +0000 (10:32 -0800)
committerRaman Tenneti <rtenneti@google.com>
Wed, 22 Feb 2023 18:40:38 +0000 (10:40 -0800)
commitd0d6d78bbda7cea3408ab2686f67e38b6fa52c6e
tree6414447bbd927a876c1f03976edd5fc7f3665715
parent1ddc41c3d165ae5125d6a6ed8e7d30feb74b2a30
[libc] Implement ntohl and ntohs

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>
Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D144506
14 files changed:
libc/config/linux/aarch64/entrypoints.txt
libc/config/linux/x86_64/entrypoints.txt
libc/spec/posix.td
libc/src/network/CMakeLists.txt
libc/src/network/htons.h
libc/src/network/ntohl.cpp [new file with mode: 0644]
libc/src/network/ntohl.h [new file with mode: 0644]
libc/src/network/ntohs.cpp [new file with mode: 0644]
libc/src/network/ntohs.h [new file with mode: 0644]
libc/test/src/network/CMakeLists.txt
libc/test/src/network/htonl_test.cpp
libc/test/src/network/htons_test.cpp
libc/test/src/network/ntohl_test.cpp [new file with mode: 0644]
libc/test/src/network/ntohs_test.cpp [new file with mode: 0644]