Searches the network database sequentially from the beginning of the database for a network record with a given name or alias.
#include <netdb.h> struct netent *getnetbyname (char *name);
The getnetent, getnetbyaddr, and getnetbyname routines all use a common static area for their return values. This means that subsequent calls to any of these routines will overwrite any existing network entry. You must make a copy of the network entry if you wish to save it.
NULL | Indicates EOF or an error; errno is set to EFAULT (The buffer described by name is not a valid, writable part of the user address space.) |
x | A pointer to an object having the netent
structure. See the <netdb.h> header file for a description of the
netent structure.
Depending on the error condition and the socket implementation selected, errno or h_errno might be set to further indicate the error. (See sections A.5 and A.6.) |