rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 64 forks source link

linux/timerfd: stop explicitly casting to c_long for timespec.tv_nsec #189

Open mjt0k opened 1 year ago

mjt0k commented 1 year ago

struct timespec.tv_nsec is implementation-specific (even if the doc says it is c_long). For example, on x32 it is i64. Do not explicitly cast nsec value to c_long, use whatever type needed for the target type. This also simplifies the code (avoiding temporary variable).