nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.58k stars 133 forks source link

Syscalls: add support for memfd_create #2005

Closed francescolavra closed 6 months ago

francescolavra commented 6 months ago

This syscall creates an anonymous file that behaves like a regular file, and so can be modified, truncated, memory-mapped, and so on, but, unlike a regular file, lives in RAM and has a volatile backing storage. This syscall is implemented in a new "shmem" klib, which is meant to contain the implementation of all shared-memory features in the kernel. The memfd implementation relies on an underlying tmpfs filesystem, which is implemented in another new klib named "tmpfs" (which in the future can be used to create arbitrary RAM-backed filesystems and mount them at arbitrary locations in the root filesystem).

Closes https://github.com/nanovms/nanos/issues/1986.