1*c9945492SAndroid Build Coastguard Worker #define _GNU_SOURCE 2*c9945492SAndroid Build Coastguard Worker #include <netdb.h> 3*c9945492SAndroid Build Coastguard Worker getservbyport(int port,const char * prots)4*c9945492SAndroid Build Coastguard Workerstruct servent *getservbyport(int port, const char *prots) 5*c9945492SAndroid Build Coastguard Worker { 6*c9945492SAndroid Build Coastguard Worker static struct servent se; 7*c9945492SAndroid Build Coastguard Worker static long buf[32/sizeof(long)]; 8*c9945492SAndroid Build Coastguard Worker struct servent *res; 9*c9945492SAndroid Build Coastguard Worker if (getservbyport_r(port, prots, &se, (void *)buf, sizeof buf, &res)) 10*c9945492SAndroid Build Coastguard Worker return 0; 11*c9945492SAndroid Build Coastguard Worker return &se; 12*c9945492SAndroid Build Coastguard Worker } 13