fix: inherit process environment and untrack libc objects
This commit is contained in:
1 parent
0a91131cb0
commit
3ef98a9fd5
26 files changed
+254
-36
No files matched your search
@@ -65,6 +65,7 @@ namespace Sched {
|
||||
};
|
||||
|
||||
struct Process {
|
||||
static constexpr uint32_t EnvironmentBytes = 4096;
|
||||
int pid;
|
||||
ProcessState state;
|
||||
int waitingForPid; // PID this process is blocked on (-1 if none)
|
||||
@@ -82,6 +83,8 @@ namespace Sched {
|
||||
uint64_t heapNext; // Simple bump allocator for user heap
|
||||
uint32_t readdirCursor; // Next SYS_READDIR scratch slot
|
||||
char args[4096]; // Command-line arguments (set by parent via Spawn)
|
||||
char environment[EnvironmentBytes]; // NUL-separated NAME=VALUE entries
|
||||
uint32_t environmentLength;
|
||||
char user[32]; // Owner user name (inherited from parent on spawn)
|
||||
char cwd[256]; // Absolute current working directory
|
||||
|
||||
@@ -139,7 +142,8 @@ namespace Sched {
|
||||
};
|
||||
|
||||
void Initialize();
|
||||
int Spawn(const char* vfsPath, const char* args = nullptr, bool startReady = true);
|
||||
int Spawn(const char* vfsPath, const char* args = nullptr, bool startReady = true,
|
||||
const char* environment = nullptr, uint32_t environmentLength = 0);
|
||||
int StartProcess(int pid);
|
||||
void Schedule();
|
||||
|
||||
|
||||
Reference in new issue
Block a user