diff --git a/src/libos/src/events/host_event_fd.rs b/src/libos/src/events/host_event_fd.rs index aff80a19..8e44ee17 100644 --- a/src/libos/src/events/host_event_fd.rs +++ b/src/libos/src/events/host_event_fd.rs @@ -65,6 +65,10 @@ impl HostEventFd { /// /// Precondition. The caller must ensure that the host fds are valid. pub unsafe fn write_u64_raw_and_batch(host_fds: &[FileDesc], val: u64) { + if host_fds.len() == 0 { + return; + } + ocall_eventfd_write_batch(host_fds, val); }