`err` is set directly from the value of the OCaml `Unix.error` constructor number, rather than looked up in a table (as is done in `unixsupport.c`).  Hence this function and the enumeration.