fork download
  1. #include <netdb.h>
  2.  
  3. int
  4. main(void)
  5. {
  6. struct protoent *p;
  7.  
  8. setprotoent(0);
  9. p = getprotobyname("tcp");
  10. printf("%d\n", p->p_proto);
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 4536KB
stdin
Standard input is empty
stdout
6