Skip to content

Instantly share code, notes, and snippets.

@bdossantos
Created December 14, 2011 14:13
Show Gist options
  • Select an option

  • Save bdossantos/1476720 to your computer and use it in GitHub Desktop.

Select an option

Save bdossantos/1476720 to your computer and use it in GitHub Desktop.
proto.c
#include <stdio.h>
#include <netdb.h>
int main(void) {
struct protoent *proto;
setprotoent(0);
while ((proto = getprotoent()) != NULL) {
fprintf (stdout, "%s ", proto->p_name);
}
endprotoent();
fprintf (stdout, "\n");
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment