projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
make .rhosts a bit more forgiving
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
getservbyport.c
/* getservbyport.c 4.2 82/10/05 */
#include <netdb.h>
struct
servent
*
getservbyport
(
port
,
proto
)
int
port
;
char
*
proto
;
{
register
struct
servent
*
p
;
setservent
(
0
);
while
(
p
=
getservent
()) {
if
(
p
->
s_port
!=
port
)
continue
;
if
(
proto
==
0
||
strcmp
(
p
->
s_proto
,
proto
) ==
0
)
break
;
}
endservent
();
return
(
p
);
}