The getservent() call reads the next line of the hlq.ETC.SERVICES data set and returns a pointer to the next entry in the hlq.ETC.SERVICES data set.
#include <manifest.h>
#include <netdb.h>
struct servent *getservent()
The return value points to static data that is overwritten by subsequent calls. Points to a servent structure indicate success. A NULL pointer indicates an error or end-of-file. When a NULL pointer or 0 is returned, the value of errno is indeterminate, and therefore, the output from a tcperror() call cannot be validated.
endservant(), getservbyname(), getservbyport(), setservent()