summaryrefslogblamecommitdiff
path: root/src/network/gethostbyaddr.c
blob: 51e1c5699856be573a3e45e288af2689772e07be (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                   
#define _GNU_SOURCE

#include <netdb.h>
#include <string.h>
#include <netinet/in.h>

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