while(f>oldlimit){intdecr_step=16;limit.rlim_cur=f;limit.rlim_max=f;if(setrlimit(RLIMIT_NOFILE,&limit)!=-1)break;setrlimit_error=errno;/*Wefailedtosetfilelimitto'f'.Trywitha*smallerlimitdecrementingbyafewFDsperiteration.*/if(ff-=decr_step;}网上说软限制不能超出硬限制,为什么不直接把软限制改成和硬限制一样大呢,如上代码(redis源码)还尝试什么?
慕勒3428872
白板的微信
随时随地看视频慕课网APP
相关分类