Files
42_KFS/headers/process.h
2025-11-30 13:32:24 +01:00

33 lines
574 B
C

#pragma once
#include "list.h"
#include "signal.h"
#include "thread.h"
#include <stdint.h>
extern struct pcb *current_pcb;
enum owner { OWNER_KERNEL, OWNER_USER };
typedef uint16_t pid_t;
typedef uint8_t uid_t;
struct pcb {
void *cr3;
uint32_t *heap;
pid_t pid;
uid_t uid;
tid_t tid;
struct signal_data signals;
struct pcb *next;
struct pcb *prev;
struct pcb *daddy;
struct list *children;
struct list *thread_list;
};
void switch_process(struct pcb *next_pcb);
struct pcb *create_process(uid_t uid);
void remove_process(struct pcb *pcb);
pid_t fork(void);