io_event::res is a signed int64 in kernel, but libaio defines it as unsigned long. We should cast it to a signed value.