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:
10
benchtests/inet_ntop_ipv4-source.c
Normal file
10
benchtests/inet_ntop_ipv4-source.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user