1 // RUN: %clangxx -O0 -g %s -o %t
4 // bionic/netdb.cpp is not implemented.
5 // UNSUPPORTED: android
13 struct protoent
*ptp
= getprotoent();
14 assert(ptp
&& ptp
->p_name
);
15 assert(ptp
->p_proto
== 0);
16 char **aliases
= ptp
->p_aliases
;
18 printf("%s\n", *aliases
);
25 struct protoent
*ptp
= getprotobyname("tcp");
26 assert(ptp
&& ptp
->p_name
);
27 assert(ptp
->p_proto
== 6);
28 char **aliases
= ptp
->p_aliases
;
30 printf("%s\n", *aliases
);
37 struct protoent
*ptp
= getprotobynumber(1);
38 assert(ptp
&& ptp
->p_name
);
39 assert(ptp
->p_proto
== 1);
40 char **aliases
= ptp
->p_aliases
;
42 printf("%s\n", *aliases
);
50 struct protoent
*ptp
= getprotobynumber(1);
52 ptp
= getprotobynumber(2);
53 assert(ptp
&& ptp
->p_name
);
54 assert(ptp
->p_proto
== 2);