libcamera
v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
|
Helper class to create anonymous files. More...
Public Types | |
enum | Seal { None = 0, Shrink = (1 << 0), Grow = (1 << 1) } |
Seals for the MemFd::create() function. | |
using | Seals = Flags< Seal > |
A bitwise combination of MemFd::Seal values. | |
Static Public Member Functions | |
static UniqueFD | create (const char *name, std::size_t size, Seals seals=Seal::None) |
Create an anonymous file. More... | |
Helper class to create anonymous files.
Anonymous files behave like regular files, and can be modified, truncated, memory-mapped and so on. Unlike regular files, they however live in RAM and don't have permanent backing storage.
|
static |
Create an anonymous file.
[in] | name | The file name (displayed in symbolic links in /proc/self/fd/) |
[in] | size | The file size |
[in] | seals | The file seals |
This function is a helper that wraps anonymous file (memfd) creation and sets the file size and optional seals.