From 0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 12 Feb 2011 00:22:29 -0500 Subject: initial check-in, version 0.5.0 --- src/network/gethostbyaddr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/network/gethostbyaddr.c (limited to 'src/network/gethostbyaddr.c') diff --git a/src/network/gethostbyaddr.c b/src/network/gethostbyaddr.c new file mode 100644 index 00000000..51e1c569 --- /dev/null +++ b/src/network/gethostbyaddr.c @@ -0,0 +1,15 @@ +#define _GNU_SOURCE + +#include +#include +#include + +struct hostent *gethostbyaddr(const void *a, socklen_t l, int af) +{ + static struct hostent h; + static long buf[512/sizeof(long)]; + struct hostent *res; + if (gethostbyaddr_r(a, l, af, &h, + (void *)buf, sizeof buf, &res, &h_errno)) return 0; + return &h; +} -- cgit v1.2.1