initial check-in, version 0.5.0
This commit is contained in:
commit
0b44a0315b
1021 changed files with 45711 additions and 0 deletions
15
src/network/gethostbyaddr.c
Normal file
15
src/network/gethostbyaddr.c
Normal file
|
|
@ -0,0 +1,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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue