例如在手册页中它说:
The mmap() function shall fail if:
EACCES
The fildes argument is not open for read, regardless of the protection specified,
fildes is not open for write and PROT_WRITE was specified for a MAP_SHARED type
mapping.
还有很多其他案件。我假设有一种方法来检查发生了哪个错误但是一小时的搜索没有产生任何结果。如何检查是否发生了特定错误?
答案 0 :(得分:1)
答案 1 :(得分:0)
如果您使用C ++
,也可以这样做std::cerr << strerror(errno) << std::endl;
更多详细信息可在此处找到: