projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
BSD 4_1c_2 development
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
common
/
getnetbyname.c
/* getnetbyname.c 4.2 82/10/05 */
#include <netdb.h>
struct
netent
*
getnetbyname
(
name
)
register
char
*
name
;
{
register
struct
netent
*
p
;
register
char
**
cp
;
setnetent
(
0
);
while
(
p
=
getnetent
()) {
if
(
strcmp
(
p
->
n_name
,
name
) ==
0
)
break
;
for
(
cp
=
p
->
n_aliases
; *
cp
!=
0
;
cp
++)
if
(
strcmp
(*
cp
,
name
) ==
0
)
goto
found
;
}
found
:
endnetent
();
return
(
p
);
}