Decode the numeric error code in your strace, log file, or core dump. Search by number (13), symbol (EACCES), or message ("permission denied"). The same number means different things on Linux, macOS, and FreeBSD — this table shows which is which and which symbols are the same everywhere.
| # | Symbol | Message | OS |
|---|
The C standard gives you three errno values — EDOM, ERANGE, EILSEQ. POSIX added about 80 more for system calls and IPC. Linux, macOS, and the BSDs each layered on their own. The names like EACCES are stable across systems; the numbers are not. EAGAIN is 11 on Linux, 35 on macOS — and EAGAIN equals EWOULDBLOCK everywhere these days, but it was legal for them to differ. When in doubt, log strerror(errno) and the symbolic name, not just the integer.