getservent

Gets a services file entry from the network services database file.

Format

#include  <netdb.h>

struct servent *getservent  (void);

Description

The getservent routine reads the next line of the network services database file, opening a connection to the database, if necessary.

This routine returns a servent structure that contains fields for a line of information from the network services database file. See the <netdb.h> header file for a description of the hostent structure.

This routine uses a common static area for its return values, so subsequent calls to this routine overwrite any existing network entry. You must make a copy of the network services entry, if you wish to save it.

See also setservent, and endservent in this section.

Return Values
A pointer to a servent structure. 
NULL  Indicates an error or EOF. 


Previous Page | Next Page | Table of Contents | Index