例如在手册页中它说:
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.
还有一堆其他的情况。我假设有一种方法可以检查发生了哪个错误,但是一小时的搜索一无所获。您如何检查是否发生了该特定错误?