Replace arbitrary defines with OS defines from limits.h.
Use "r" and "w" instead of READA, WRITE{A,B}.