projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
date and time created 82/08/25 21:54:17 by sam
[unix-history]
/
usr
/
src
/
lib
/
libc
/
net
/
getservbyport.c
/* getservbyport.c 4.1 82/08/25 */
#include <netdb.h>
struct
servent
*
getservport
(
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
);
}