Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getnetbyname(3) OSS Library Calls Reference Manual
NAME
getnetbyname - Gets a network entry by name
LIBRARY
G-series native OSS processes: /G/system/sysnn/zinetsrl
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zinetdll |
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/yinetdll |
SYNOPSIS
#include <netdb.h>
struct netent *getnetbyname (
const char *name);
PARAMETERS
name Specifies the network name or alias.
DESCRIPTION
The getnetbyname( ) function searches the /etc/networks file sequentially until a match with the
name parameter is found.
The getnetbyname( ) function returns a pointer to a structure of type netent whose members
specify data from the /etc/networks network database le. The netdb.h header file defines the
netent structure.
NOTES
The getnetbyname( ) return value points to static data, which is overwritten by any subsequent
calls to getnetbyaddr( ), getnetbyname( ),orgetnetent( ).
RETURN VALUES
Upon successful completion, the getnetbyname( ) function returns a pointer to a netent structure
if the network name was found, and a null pointer if it was not found. If the call to getnet-
byname( ) fails, a null pointer is returned.
ERRORS
The getnetbyname( ) function does not return a value in errno.
FILES
/etc/networks The Internet network name database file. Each record in the file occupies a single
line and has three fields: the network name, the network number, and aliases.
RELATED INFORMATION
Functions: getnetent(3), getnetbyaddr(3), setnetent(3), endnetent(3).
Files: networks(4).
388 Hewlett-Packard Company 527187-017