Reputation: 3931
For example in man page it says:
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.
There are bunch of other cases. I am assuming there is a way to check which error has occurred however a hour of search yielded nothing. How do you check if that particular error has occured?
Upvotes: 0
Views: 188
Reputation: 43
You could also do this if you are using C++
std::cerr << strerror(errno) << std::endl;
More detailed information can be found here:
Upvotes: 0
Reputation: 224844
That error value will be saved in the global variable errno
. You can get a human readable string from perror(3)
.
Upvotes: 1