Add constructors to mmap_unix
sboeuf opened this issue · comments
Sebastien Boeuf commented
It'd be useful to add a global constructor to MmapRegion
in mmap_unix.rs
(here) since this would provide a proper wrapper for the mmap()
syscall.
The point would be to be able to provide PROT_NONE/READ/WRITE
along with MAP_SHARED/PRIVATE/...
, so that we're not tied to the predefined prototype and map types.
Sebastien Boeuf commented
@bonzini @jiangliu @alexandruag wdyt?
Jiang Liu commented
@bonzini @jiangliu @alexandruag wdyt?
We have used the build() constructor to create mmap region for virtio-fs:)
And the libc::MAP_NORESERVE flags may be a special case for virtio-fs.
Sebastien Boeuf commented
Oh my bad, I didn't even see the build()
constructor...