1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00

benchtests: Add IPv4 inet_ntop benchmark

Random IP addresses in the full range.
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: DJ Delorie <dj@redhat.com>
This commit is contained in:
Adhemerval Zanella
2025-06-04 17:42:40 -03:00
parent fc6f074e04
commit e6ad9650fb
3 changed files with 1019 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#include <arpa/inet.h>
#include <stdint.h>
static void
inet_ntop_ipv4 (uint32_t addr)
{
struct in_addr saddr = { .s_addr = addr };
char dst[INET_ADDRSTRLEN];
inet_ntop (AF_INET, &saddr, dst, sizeof dst);
}