Skip to content

Instantly share code, notes, and snippets.

@snosrap
Created April 12, 2017 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snosrap/2797a0de763486eab4e3b49b537817a7 to your computer and use it in GitHub Desktop.
Save snosrap/2797a0de763486eab4e3b49b537817a7 to your computer and use it in GitHub Desktop.
struct servent *s = getservbyname("http", NULL);
if(!!s) {
NSLog(@"%s %i %s", s->s_name, CFSwapInt16BigToHost(s->s_port), s->s_proto);
for(size_t i=0; !!s->s_aliases[i]; i++) {
NSLog(@"%lu\t%s", i, s->s_aliases[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment