Handle process arguments

This commit is contained in:
2025-09-10 23:25:03 +02:00
parent 2f9f4d9397
commit dc3d80d707
13 changed files with 127 additions and 23 deletions

View File

@ -7,6 +7,7 @@
#include "bitmap/bitmap.h"
#include "vfs/vfs.h"
#include "ipc/pipe/pipe.h"
#include "sysdefs/processctl.h"
#define PROC_NAME_MAX 0x100
@ -33,6 +34,11 @@ enum {
PROC_WAITING = 3,
};
typedef struct ProcArg {
struct ProcArg *next;
char string[PROC_ARG_MAX];
} ProcArg;
typedef struct Proc {
struct Proc *next;
@ -53,6 +59,10 @@ typedef struct Proc {
IpcPipe *list;
SpinLock spinlock;
} bcast_pipes;
struct {
ProcArg *list;
size_t len;
} procargs;
uint64_t mman_map_base;
} Proc;
@ -79,4 +89,12 @@ void proc_kill(Proc *proc);
for(;;); \
} while(0)
#define PROC_ARG(proc, str) \
do { \
ProcArg *__arg = dlmalloc(sizeof(*__arg)); \
hal_strcpy(__arg->string, (str)); \
LL_APPEND((proc)->procargs.list, __arg); \
(proc)->procargs.len++; \
} while(0)
#endif // PROC_PROC_H_