version 1.182, 2001/10/24 17:06:03
|
version 1.183, 2001/10/25 22:23:55
|
Line 111 int traverse(const char* file, const str
|
Line 111 int traverse(const char* file, const str
|
#endif |
#endif |
|
|
int main(int argc,char *argv[]) { |
int main(int argc,char *argv[]) { |
struct servent* se; |
#ifdef NEW |
if (se=getservbyname("pop-3","tcp")) { |
struct protoent se,*tmp; |
|
char buf[1000]; |
|
while (getprotoent_r(&se,buf,sizeof(buf),&tmp)==0) { |
int i; |
int i; |
printf("name %s\tport %d\tproto %s\n",se->s_name,se->s_port,se->s_proto); |
printf("name %s\tproto %d\n",se.p_name,se.p_proto); |
for (i=0; i<16; ++i) { |
for (i=0; i<16; ++i) { |
if (!se->s_aliases[i]) break; |
if (!se.p_aliases[i]) break; |
printf(" alias %s\n",se->s_aliases[i]); |
printf(" alias %s\n",se.p_aliases[i]); |
} |
} |
} |
} |
|
#else |
|
struct protoent* se; |
|
while (se=getprotoent()) { |
|
int i; |
|
printf("name %s\tproto %d\n",se->p_name,se->p_proto); |
|
for (i=0; i<16; ++i) { |
|
if (!se->p_aliases[i]) break; |
|
printf(" alias %s\n",se->p_aliases[i]); |
|
} |
|
} |
|
#endif |
#if 0 |
#if 0 |
fd_set f; |
fd_set f; |
struct timeval tv; |
struct timeval tv; |