1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00
Files
glibc/benchtests/inet_ntop_ipv4-source.c
Adhemerval Zanella e6ad9650fb 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>
2025-06-24 09:43:02 -03:00

11 lines
213 B
C

#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);
}