aboutsummaryrefslogtreecommitdiff
path: root/src/network/getservbyport.c
blob: 819e253341616c770bb618bce37d3d249ac69cba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#define _GNU_SOURCE
#include <netdb.h>

struct servent *getservbyport(int port, const char *prots)
{
	static struct servent se;
	static long buf[32/sizeof(long)];
	struct servent *res;
	if (getservbyport_r(port, prots, &se, (void *)buf, sizeof buf, &res))
		return 0;
	return &se;
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif