projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
fixed several bugs.
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
getprotoname.c
/* getprotoname.c 4.2 82/10/05 */
#include <netdb.h>
struct
protoent
*
getprotobyname
(
name
)
register
char
*
name
;
{
register
struct
protoent
*
p
;
register
char
**
cp
;
setprotoent
(
0
);
while
(
p
=
getprotoent
()) {
if
(
strcmp
(
p
->
p_name
,
name
) ==
0
)
break
;
for
(
cp
=
p
->
p_aliases
; *
cp
!=
0
;
cp
++)
if
(
strcmp
(*
cp
,
name
) ==
0
)
goto
found
;
}
found
:
endprotoent
();
return
(
p
);
}