libcamera v0.5.1
Supporting cameras in Linux since 2019
|
Helper class to create anonymous files. More...
Public Types | |
enum class | Seal { None = 0 , Shrink = (1 << 0) , Grow = (1 << 1) } |
Seals for the MemFd::create() function. More... | |
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. |
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.
|
strong |
Seals for the MemFd::create() function.
Enumerator | |
---|---|
None | No seals (used as default value) |
Shrink | Prevent the memfd from shrinking. |
Grow | Prevent the memfd from growing. |
|
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.