Use getrlimit and setrlimit to set limits for number of simultaneously open file descriptors. Get the current limits and try to raise them if they're not enough for the specified (or the default) setting of max connections.
Use getrlimit and setrlimit to set limits for number of simultaneously
open file descriptors. Get the current limits and try to raise them if
they're not enough for the specified (or the default) setting of max
connections.

Do this before dropping root (if run as root) so we can raise the max limit
if needed.


git-svn-id: 712aefb8596620db6486b8151c1cac37df8d9591@194 b0b603af-a30f-0410-a34e-baf09ae79d0b

memcached/memcached,williamcheungthu/memcached,alexandermerritt/memcached,sagark/memcached-accel,DigitalAce/memcached,ZhangZhenhua/memcached,tomykaira/memcached,mrkwse/memcached,allen8807/memcached-1,13693100472/memcached,abhinavdangeti/memcached,zbase/memcached,neutronsharc/memcached,shelsonjava/memcached,rmccullagh/memcached,leedc/memcached,Dhruva6/memcached,angusfenying/memcached-win64,saumitra/memcached,jbergstroem/memcached,bpzhang/memcached,rmccullagh/memcached,rhli/memcached,tmharrisonwang/memcached,couchbase/memcached,Distrotech/memcached,elfchief/memcached,rmccullagh/memcached,xiaosl/memcached,niaomingjian/memcached,DSrcl/memcached,gencer/memcached,dustin/memcached,zbase/moxi,fengshao0907/memcached,DSrcl/memcached,DSrcl/memcached,allen8807/memcached-1,dianerdianer/memcached,cloudrain21/memcached-1,fengshao0907/memcached,rmccullagh/memcached,Dhruva6/memcached,bpzhang/memcached,membase/moxi,zaycev/memcached,owendCB/memcached,dormando/memcached,xiaosl/memcached,osheroff/memcached_kdtree,mitliucak/memcached,surajdharmapuram/memcached,zbase/memcached,shelsonjava/memcached,EdwardLee03/memcached,jbergstroem/memcached,guikcd/memcached,romanticode/memcached,jbergstroem/memcached,dormando/memcached,gencer/memcached,alexandermerritt/memcached,abhinavdangeti/memcached,rhli/memcached,rhli/memcached,Metaswitch/memcached,daverigby/memcached,Danzeer/memcached,EdwardLee03/memcached,shelsonjava/memcached,cloudrain21/memcached-1,dormando/memcached,jeremiahyan/memcached,xiaosl/memcached,guikcd/memcached,zbase/moxi,dkrotx/memcached-dd,dormando/memcached,owendCB/memcached,couchbase/memcached,steveyen/moxi,myPublicGit/memcached,EdwardLee03/memcached,cloudrain21/memcached-1,couchbase/moxi,myPublicGit/memcached,owendCB/memcached,leverich/memcached-affinity,couchbase/moxi,leedc/memcached,jimwwalker/memcached,zaycev/memcached,tomykaira/memcached,williamcheungthu/memcached,kamyu104/memcached,13693100472/memcached,allen8807/memcached-1,zbase/memcached,couchbase/memcached,allen8807/memcached-1,memcached/memcached,osheroff/memcached_kdtree,amyvmiwei/memcached,emcconville/memcached,steveyen/moxi,romanticode/memcached,xiaosl/memcached,myPublicGit/memcached,dkrotx/memcached-dd,leedc/memcached,zbase/memcached,emcconville/memcached,Dhruva6/memcached,mitliucak/memcached,kamyu104/memcached,dianerdianer/memcached,cloudrain21/memcached,zaycev/memcached,zbase/moxi,dkrotx/memcached-dd,couchbase/moxi,cloudrain21/memcached-1,cloudrain21/memcached,niaomingjian/memcached,Distrotech/memcached,gencer/memcached,fengshao0907/memcached,abhinavdangeti/memcached,mdounin/memcached,msg7086/repcached,mdounin/memcached,sagark/memcached-accel,myPublicGit/memcached,surajdharmapuram/memcached,amyvmiwei/memcached,tmharrisonwang/memcached,msg7086/repcached,mrkwse/memcached,DigitalAce/memcached,zbase/moxi,leverich/memcached-affinity,13693100472/memcached,elfchief/memcached,dianerdianer/memcached,13693100472/memcached,dustin/memcached,samanbarghi/memcached,emcconville/memcached,DigitalAce/memcached,Danzeer/memcached,couchbase/memcached,ClearwaterCore/memcached,sagark/memcached-accel,Dhruva6/memcached,samanbarghi/memcached,DSrcl/memcached,membase/moxi,angusfenying/memcached-win64,zbase/moxi,niaomingjian/memcached,couchbase/moxi,ClearwaterCore/memcached,tellapart/memcached,zaycev/memcached,couchbase/moxi,rhli/memcached,jeremiahyan/memcached,abhinavdangeti/memcached,guikcd/memcached,elfchief/memcached,Distrotech/memcached,mrkwse/memcached,shelsonjava/memcached,samt42/memcached,cloudrain21/memcached,guikcd/memcached,bpzhang/memcached,steveyen/moxi,tmharrisonwang/memcached,13693100472/memcached,samt42/memcached,jimwwalker/memcached,couchbase/moxi,membase/moxi,samanbarghi/memcached,romanticode/memcached,gencer/memcached,tellapart/memcached,Metaswitch/memcached,Danzeer/memcached,memcached/memcached,fengshao0907/memcached,daverigby/memcached,ZhangZhenhua/memcached,saumitra/memcached,steveyen/moxi,daverigby/memcached,samt42/memcached,zbase/memcached,tmharrisonwang/memcached,membase/moxi,EdwardLee03/memcached,ZhangZhenhua/memcached,ZhangZhenhua/memcached,gencer/memcached,surajdharmapuram/memcached,romanticode/memcached,dianerdianer/memcached,Metaswitch/memcached,dustin/memcached,memcached/memcached,dormando/memcached,msg7086/repcached,msg7086/repcached,kamyu104/memcached,amyvmiwei/memcached,kamyu104/memcached,memcached/memcached,elfchief/memcached,saumitra/memcached,elfchief/memcached,daverigby/memcached,sagark/memcached-accel,daverigby/kv_engine,bpzhang/memcached,neutronsharc/memcached,niaomingjian/memcached,abhinavdangeti/memcached,guikcd/memcached,osheroff/memcached_kdtree,amyvmiwei/memcached,angusfenying/memcached-win64,tellapart/memcached,ClearwaterCore/memcached,dkrotx/memcached-dd,leedc/memcached,angusfenying/memcached-win64,owendCB/memcached,mrkwse/memcached,neutronsharc/memcached,daverigby/kv_engine,membase/moxi,steveyen/moxi,neutronsharc/memcached,rmccullagh/memcached,daverigby/kv_engine,Metaswitch/memcached,samt42/memcached,mdounin/memcached,tomykaira/memcached,jeremiahyan/memcached,Metaswitch/memcached,jeremiahyan/memcached,alexandermerritt/memcached,leverich/memcached-affinity,msg7086/repcached,cloudrain21/memcached,alexandermerritt/memcached,williamcheungthu/memcached,daverigby/kv_engine,tomykaira/memcached,jimwwalker/memcached,membase/moxi,Danzeer/memcached,mitliucak/memcached,ClearwaterCore/memcached,mitliucak/memcached,emcconville/memcached,samanbarghi/memcached,williamcheungthu/memcached,sagark/memcached-accel,surajdharmapuram/memcached