linux: Fix broken process limits implementation

This commit is contained in:
EnderIce2
2024-10-13 02:19:26 +03:00
parent 02cf233534
commit 93e8e3f354
3 changed files with 78 additions and 23 deletions

View File

@ -451,6 +451,7 @@ namespace Tasking
bool IsCritical = false;
bool IsDebugEnabled = false;
bool IsKernelDebugEnabled = false;
bool CanAdjustHardLimits = false;
struct
{
uint16_t UserID = UINT16_MAX;
@ -460,11 +461,17 @@ namespace Tasking
pid_t SessionID = 0;
} Security{};
struct
{
rlim_t OpenFiles = 128;
rlim_t Threads = 64;
rlim_t Memory = 1073741824; /* 1 GiB */
} SoftLimits{};
struct
{
rlim_t OpenFiles = 4096;
rlim_t Threads = 1024;
rlim_t Memory = 8589934592; /* 8 GiB */
} Limits{};
} HardLimits{};
TaskInfo Info{};
ThreadLocalStorage TLS{};