interface: use the CHECK_ERROR macro for error set by system call