Chinaunix

标题: 一个进程中fopen可打开的最大文件数是多少 [打印本页]

作者: ublue    时间: 2007-04-27 17:00
标题: 一个进程中fopen可打开的最大文件数是多少
请问 一个进程中fopen可打开的最大文件数是多少?

如果/etc/system根本上没配置,那缺省的值是多少?

听说fopen和open函数打开的文件的最大数有差异,

以前听说fopen最多只能打开256个文件,怎么我在solaris8下测试时不受这限制,测试到300都没问题,(/etc/system配置为set rlim_fd_cur=4096  set rlim_fd_max=4096)


请高手帮忙澄清一下,多谢了
作者: cuwiner    时间: 2007-04-27 17:05

作者: happyham    时间: 2007-04-28 11:43
You can check the default (soft) limit and hard limit values via ulimit:

ulimit -a (soft)
ulimit -Ha (hard)

To tune it via /etc/system for the entire system (a regular reboot is necessary):

set rlim_fd_cur=<nofiles>
set rlim_fd_max=<nofiles>




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2