rust-vmm / vmm-sys-util

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

Make SyscallReturnCode more generic #151

Closed alindima closed 1 year ago

alindima commented 3 years ago

SyscallReturnCode wraps only a c_int return value from a syscall. While generally ok, there are syscalls that return other types. For example, mmap returns a void*, which is not representable by a c_int on 64-bit systems.

One option for fixing this would be to make SyscallReturnCode generic, wrapping a value of type T. Another option would be to simply use c_long for this, since a 64-bit int can also be used to represent the 32-bit counterpart.

alindima commented 1 year ago

fixed by https://github.com/rust-vmm/vmm-sys-util/pull/201