xref: /third_party/musl/src/network/getservbyname.c (revision 570af302)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/musl/src/network/
1570af302Sopenharmony_ci#define _GNU_SOURCE
2570af302Sopenharmony_ci#include <netdb.h>
3570af302Sopenharmony_ci
4570af302Sopenharmony_cistruct servent *getservbyname(const char *name, const char *prots)
5570af302Sopenharmony_ci{
6570af302Sopenharmony_ci	static struct servent se;
7570af302Sopenharmony_ci	static char *buf[2];
8570af302Sopenharmony_ci	struct servent *res;
9570af302Sopenharmony_ci	if (getservbyname_r(name, prots, &se, (void *)buf, sizeof buf, &res))
10570af302Sopenharmony_ci		return 0;
11570af302Sopenharmony_ci	return &se;
12570af302Sopenharmony_ci}
13

Indexes created Thu Nov 07 10:32:03 CST 2024