summaryrefslogtreecommitdiffstats
path: root/lib/libc/yp
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1996-06-01 04:40:42 +0000
committerwpaul <wpaul@FreeBSD.org>1996-06-01 04:40:42 +0000
commitf96a6bec7fc3dcdc42d9d842779178e93798aac2 (patch)
tree88a15fae0931f2ee7da2910b94f61e8f0d043458 /lib/libc/yp
parenta90d30f14691d10790925c99a7bcc9921319d21e (diff)
downloadFreeBSD-src-f96a6bec7fc3dcdc42d9d842779178e93798aac2.zip
FreeBSD-src-f96a6bec7fc3dcdc42d9d842779178e93798aac2.tar.gz
Improve NIS performace of getservbyname() and getservbyport(). Both these
functions are implimented as wrappers around getservent(), which means it's up to getservent() to do all the work. The NIS support in getservent() only allows it to scan through the services.byname map one entry at a time until it finds the requested service name/port. This can be painfully slow due to the overhead involved (lots and lots of successive RPCs). To fix this, we allow getservbyname() and getservbyport() to signal getservent() that if NIS is turned on (there's a '+' in /etc/services), the usual yp_first()/yp_next() linear search should be abandoned and yp_match() used instead. This causes getservent() to immediately locate the requested entry instead of wasting time groping through the whole map. The downside is that this trick is accomplished by exporting a couple of pointers from getservent.c which getservbyname.c and getservbyport.c can preset in order to tell getservent() what to do. If all three functions were in the same source module, then the extra cruft could be delcared static to avoid poluting the global symbol space. Maybe they should be combined anyway. For now I've settled on prepending lots of underscores.
Diffstat (limited to 'lib/libc/yp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud