【发布时间】:2012-12-03 08:01:06
【问题描述】:
给定 tmp.c:
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
int main(int argc, const char *argv[])
{
struct stat st;
if (stat(argv[1], &st) != 0)
{
perror("Error calling stat");
}
return 0;
}
当我在一个大文件(~2.5 Gb)上运行程序时,我得到了Error calling stat: Value too large for defined data type。
【问题讨论】:
-
只有在文件大小超过
(2<<31)-1位时,才会在 32 位系统上发生此 (EOVERFLOW)。
标签: c posix runtime-error system-calls