* Copyright (c) 1983 Regents of the University of California.
* %sccs.include.redist.c%
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)getnetent.c 5.8 (Berkeley) %G%";
#endif /* LIBC_SCCS and not lint */
static char line
[BUFSIZ
+1];
static struct netent net
;
static char *net_aliases
[MAXALIASES
];
netf
= fopen(_PATH_NETWORKS
, "r" );
if (netf
== NULL
&& (netf
= fopen(_PATH_NETWORKS
, "r" )) == NULL
)
p
= fgets(line
, BUFSIZ
, netf
);
while (*cp
== ' ' || *cp
== '\t')
net
.n_net
= inet_network(cp
);
net
.n_addrtype
= AF_INET
;
q
= net
.n_aliases
= net_aliases
;
if (*cp
== ' ' || *cp
== '\t') {
if (q
< &net_aliases
[MAXALIASES
- 1])