is a SunOS invention.
A netgroup database is a list of string triples
(hostname, username, domainname)
or other netgroup names.
Any of the elements in a triple can be empty,
which means that anything matches.
The functions described here allow access to the netgroup databases.
defines what database is searched.
call defines the netgroup that will be searched by subsequent
function retrieves the next netgroup entry, and returns pointers in
A NULL pointer means that the corresponding entry matches any string.
The pointers are valid only as long as there is no call to other
To avoid this problem you can use the GNU function
that stores the strings in the supplied buffer.
To free all allocated buffers use
In most cases you only want to check if the triplet
is a member of a netgroup.
can be used for this without calling the above three functions.
Again, a NULL pointer is a wildcard and matches any string.
The function is thread-safe.
These functions return 1 on success and 0 for failure.
These functions are not in POSIX.1-2001, but
are available on most Unix systems.
is not widely available on other systems.
In the BSD implementation,