Gets network entry.
Standard C Library (libc.a)
#include <netdb.h>
int getnetent_r(netent, net_data)
struct netent *netent;
struct netent_data *net_data;
The getnetent_r subroutine retrieves network information by opening and sequentially reading the /etc/networks file. This subroutine internally calls the getnetent subroutine and stores the values in the hostent structure.
The getnetent subroutine overwrites the static data returned in subsequent calls. The getnetent_r subroutine does not. Use the endnetent_r subroutine to close the /etc/networks file.
Item | Description |
---|---|
netent | Points to the netent structure. |
net_data | Points to the net_data structure. |
The function returns a 0 if successful and a -1 if unsuccessful.
Item | Description |
---|---|
/etc/networks | Contains official network names. |