The Pedigree Project
0.1
src
modules
subsys
posix
memfd-file.h
1
/* Copyright (c) 2026, Pedigree Developers. */
2
#ifndef POSIX_MEMFD_FILE_H
3
#define POSIX_MEMFD_FILE_H
4
5
#include "
modules/system/ramfs/RamFs.h
"
6
7
namespace
LinuxMemFd {
8
constexpr
unsigned
CloseOnExec = 1, AllowSealing = 2;
9
constexpr
unsigned
Seal = 1, Shrink = 2, Grow = 4, Write = 8, FutureWrite = 16;
10
constexpr
unsigned
AllSeals = Seal | Shrink | Grow | Write | FutureWrite;
11
constexpr
size_t
MaximumNameLength = 249;
12
}
// namespace LinuxMemFd
13
14
class
EXPORTED_PUBLIC
MemFdFile
final :
public
RamFile
{
15
public
:
16
MemFdFile
(
const
String
& name,
bool
allowSealing,
size_t
uid,
size_t
gid);
17
~MemFdFile
()
override
=
default
;
18
19
static
MemFdFile
* fromFile(
File
* file);
20
Attributes
getAttributes()
const override
;
21
int
getSeals();
22
int
addSeals(
unsigned
seals);
23
bool
allowMapping
(
bool
shared,
bool
writeRequested,
bool
& mayWrite)
override
;
24
25
protected
:
26
bool
prepareWrite(uint64_t location, uint64_t size)
override
;
27
bool
allowResize(
size_t
oldSize,
size_t
newSize)
override
;
28
29
private
:
30
unsigned
m_Seals;
31
};
32
33
#endif
RamFs.h
An in-RAM filesystem.
File
Definition
File.h:74
File::allowMapping
virtual bool allowMapping(bool shared, bool writeRequested, bool &mayWrite)
Definition
File.cc:1093
MemFdFile
Definition
memfd-file.h:14
RamFile
Definition
RamFs.h:42
String
Definition
String.h:43
File::Attributes
Definition
File.h:223
Generated on Tue Sep 29 2026 04:30:09 for The Pedigree Project by
1.9.8