http://msdn.microsoft.com/en-us/library/6e3b887c(VS.80).aspx
有没有办法使用 _wopen 每个应用程序一次打开超过 2048 个文件。
32 或 64 位操作系统 – 相同的限制!
不。
通过查看CRT源代码,我们可以知道CRT限制了最大数量。
/*
* Make sure the request is reasonable.
*/
_VALIDATE_RETURN(((maxnum >= _IOB_ENTRIES) && (maxnum <= _NHANDLE_)), EINVAL, -1);
The NHANDLE:
#define _NHANDLE_ (IOINFO_ARRAYS * IOINFO_ARRAY_ELTS)
这些常数:
/*
* Definition of IOINFO_L2E, the log base 2 of the number of elements in each
* array of ioinfo structs.
*/
#define IOINFO_L2E 5
/*
* Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array
*/
#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
/*
* Definition of IOINFO_ARRAYS, maximum number of supported ioinfo arrays.
*/
#define IOINFO_ARRAYS 64
正如您所看到的,它受到 CRT 实现的限制。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)