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);
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 实现的限制。
关于c - _setmaxstdio 最大打开文件数仅为 2048?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1803552/