version 1.183, 2001/10/25 22:23:55
|
version 1.184, 2001/11/01 17:53:02
|
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[]) { |
#ifdef NEW |
|
struct protoent se,*tmp; |
|
char buf[1000]; |
|
while (getprotoent_r(&se,buf,sizeof(buf),&tmp)==0) { |
|
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]); |
|
} |
|
} |
|
#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; |
Line 365 int main(int argc,char *argv[]) {
|
Line 343 int main(int argc,char *argv[]) {
|
#if 0 |
#if 0 |
puts(ttyname(0)); |
puts(ttyname(0)); |
#endif |
#endif |
#if 0 |
#if 1 |
char buf[1024]; |
char buf[1024]; |
struct hostent* r; |
struct hostent* r; |
r=gethostbyname("line.org"); |
r=gethostbyname("www.convergence.de"); |
if (!r) { |
if (!r) { |
printf("dns error: %s\n",hstrerror(h_errno)); |
printf("dns error: %s\n",hstrerror(h_errno)); |
} |
} |